home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / DATABASE / ASHTIPS / DP_UT.TXT
Text File  |  1993-12-01  |  125KB  |  3,366 lines

  1. >>> "File is in use by another"
  2.  
  3. The message "File is in use by another" results from an attempt to USE a
  4. read-only database file with single-user dBASE Administrator.
  5.  
  6. To avoid this situation, use PROTECT to prevent editing of database files
  7. rather than making the files read-only.
  8.  
  9.  
  10. >>> 43-Line Mode Using the Enhanced Graphics Adapter
  11.  
  12. Users of dBASE III PLUS who have the IBM Enhanced Graphics Adapter and
  13. Display will notice that this hardware is supported but not documented.  If
  14. you enter the full-screen configuration SET at the dot prompt and select
  15. the Color menu, you will notice that instead of "Color" or "Monochrome,"
  16. "EColor25" and "EColor43" will be shown.   You can toggle between the
  17. regular 25-line mode and the IBM Enhanced Graphic Adapter's special 43-line
  18. mode by pressing the Return key.
  19.  
  20. Once in the 43-line mode, dBASE III uses all 43 lines of the screen in all
  21. display modes.  This includes regular display commands such as LIST or
  22. DISPLAY, as well as full-screen commands such as APPEND, EDIT, BROWSE,
  23. @..SAY, @..GET. Unfortunately, no command in dBASE III PLUS can toggle
  24. modes, other than the full-screen SET command.
  25.  
  26. In order to take advantage of this undocumented feature, set the switch
  27. settings on the IBM Enhanced Graphic Adapter should be as follows:
  28.  
  29.                SWITCHES
  30.       1       2       3       4
  31.      Off      On      On     Off
  32.  
  33. For more information on using of the IBM Enhanced Graphic Adapter, consult
  34. the manual provided with the card.
  35.  
  36.  
  37. >>> @...GET...PICTURE
  38.  
  39. BY J. MIKE HEDBLOM
  40.  
  41. Issuing @...GET on logical fields produces different displays when READ is
  42. executed,  depending on the presence of "@L" PICTURE function and the
  43. version of dBASE III PLUS.   If a logical field has an assigned value,
  44. @...GET displays that value.  However, if the field  has not been assigned
  45. a value, in version 1.0, @...GET displays a "?" and @...GET...PICTURE  "@L"
  46. displays "T."  Version 1.1 displays a "?" when the PICTURE function is
  47. present, but  shows a blank if the PICTURE function is not used.  
  48.  
  49.  
  50. >>> @...SAY & Overstriking
  51.  
  52. It is possible to produce overstriking on a printer with the @...SAY
  53. command in dBASE III PLUS. The documentation warns that, after executing
  54. SET DEVICE TO PRINT, an @...SAY command with row or column coordinates less
  55. than the coordinates of the previous @...SAY will cause a page eject. This
  56. is true of row coordinates. However, it is possible to @...SAY at a lesser
  57. column coordinate in the same row or even at the same coordinate. For
  58. example, the following commands produce underlined output.
  59.  
  60.    SET DEVICE TO PRINT
  61.    @ 10,20 SAY "UNDERLINE"
  62.    @ 10,20 SAY "_________"
  63.    SET DEVICE TO SCREEN
  64.  
  65.  
  66.  
  67. >>> @...SAY 
  68.  
  69. When sending control codes to the printer with @...SAY, control codes are
  70. counted as characters by dBASE III PLUS although these characters are not
  71. printed by the printer.  This causes the print position coordinates for
  72. following @...SAY commands to the same line to be offset left by the number
  73. of control code characters sent to the printer.  For instance, if one
  74. control character is sent to row 5, the column coordinate on row 5 will be
  75. less by one.
  76.  
  77.    @ 5,0 SAY CHR(15)
  78.    @ 5,12 SAY "Test"
  79.  
  80. will print "Test" starting at column 11.  The control codes for the
  81. following example are for the C-Itoh 8510A printer.
  82.  
  83.    SET DEVICE TO PRINT
  84.    @ 5,5 SAY CHR(27) + '!' + 'Test' + CHR(27) + '"'
  85.                  ^------^-----------------^------^
  86.                         |--- Each character takes one space.
  87.                         This prints the word "Test" in boldface and sets
  88.                         the type back to normal.
  89.  
  90.    @ 5,50 SAY "Test"  <------- Prints at column 46.
  91.    @ 6,50 SAY "Test"  <------- Prints at column 50.
  92.  
  93.  
  94.  
  95.  
  96. >>> @..SAY/GET
  97.  
  98. With SET SCOREBOARD ON, an @...SAY to line 0 in a format file will not
  99. write in the scoreboard area, but an @...GET will read from this area. 
  100. This is consistent with previous versions of dBASE III.  However, the
  101. larger size of the SCOREBOARD area in dBASE III PLUS increases the
  102. likelihood of conflict between SET SCOREBOARD ON and @...SAY...GET.
  103.  
  104.  
  105. >>> @...PICTURE
  106.  
  107. When you use @...PICTURE with negative numbers, you need a template
  108. position for the minus sign.  If you don't have one and the number fills
  109. the number of template digits you define an overflow will display. 
  110. Including the "@(" PICTURE function to surround negative values with
  111. parentheses also requires a position for the minus sign, although the
  112. symbol is not used.  The length of the template must be at least the length
  113. of the number plus one for the sign.  For example,
  114.  
  115.    mvar = -100
  116.    @ 5,20 SAY mvar PICTURE "999"
  117.    @ 6,20 SAY mvar PICTURE "@( 999"
  118.  
  119. each display an overflow.  However,
  120.  
  121.    @ 5,20 SAY mvar PICTURE "9999"
  122.    @ 6,20 SAY mvar PICTURE "@( 9999"
  123.  
  124. correctly display, "-100" and "(100)," respectively.
  125.  
  126.  
  127. >>> ACCEPT/WAIT
  128.  
  129. When a function key is SET to a literal character string, the ACCEPT TO
  130. command accepts the assigned string, while WAIT TO does not. Instead, the
  131. WAIT command takes the decimal ASCII representation of the function key
  132. itself. For example,
  133.  
  134.      SET FUNCTION 10 TO 'A'
  135.      WAIT TO mem
  136.      ACCEPT TO mem1
  137.  
  138. If F10 is pressed in response to the WAIT and ACCEPT commands, DISPLAY
  139. MEMORY shows a graphic character representing the ASCII code of the F10 key
  140. in mem and an "A" in mem1.
  141.  
  142. For reference, here are the values stored when these keys are pressed in
  143. response to the WAIT command.
  144.  
  145.   Key Pressed     Value     Function
  146.   ===========     =====     ========
  147.   F1              0         HELP
  148.   F2              255       ASSIST
  149.   F3              254       LIST
  150.   F4              253       DIR
  151.   F5              252       DISPLAY STRUCTURE
  152.   F6              251       DISPLAY STATUS
  153.   F7              250       DISPLAY MEMORY
  154.   F8              249       DISPLAY
  155.   F9              248       APPEND
  156.   F10             247       EDIT
  157.   SPACE           32        SPACE
  158.   BACKSPACE       127       BACKSPACE
  159.  
  160. All other keys that send nondisplay characters (including Alt,
  161. control keys, and shifted keypad characters) send an ASCII 0.
  162.  
  163.  
  164. >>> ACCESS DISK [dBASE III PLUS - Multi-User]
  165.  
  166. Because of a disk manufacturing error in which a unique access code was not
  167. recorded on System Disk #1 and System Disk #1 Back-up of dBASE III PLUS,
  168. Ashton-Tate implemented an exchange policy for the affected products.  The
  169. serial numbers of the affected products are 2500001 through 2533960. Copies
  170. of dBASE III PLUS with other serial numbers are fully functional and are
  171. not affected.
  172.  
  173. The defect involves only local area network use.  It does not affect
  174. functionality or data integrity of dBASE III PLUS when used in its
  175. stand-alone, single-user mode.  The problem was created when a special
  176. access code that permits dBASE III PLUS to be networked with other copies
  177. of dBASE III PLUS  was not placed on System Disk #1 and System Disk #1
  178. Back-up.  All other disks packaged with the product are not affected.
  179.  
  180.  
  181. >>> Accessing Filenames with No Extensions
  182.  
  183. In dBASE III PLUS, you can now access and create files with no extensions. 
  184. To access or create such a file, use the double period (..) in place of the
  185. extension.  For example, you can access an external file with no extension
  186. in the APPEND FROM command.  Virtually all dBASE III PLUS commands that
  187. operate on files support this capability.
  188.  
  189. The following list of command lines show a number of ways to work with
  190. these files.
  191.  
  192.    * ---Import a file with no extension.
  193.    APPEND FROM Yourfile.. SDF
  194.  
  195.    * ---Export a file with no extension.
  196.    COPY TO Yourfile.. SDF
  197.  
  198.    * ---Open a database file with no extension.
  199.    USE Yourfile..
  200.  
  201.    * ---Rename a file with no extension.
  202.    RENAME Yourfile.. TO Yourfile.TXT
  203.  
  204. Note that DIR does not respect the (..) notation.  You must instead use the
  205. standard wildcard notation.
  206.  
  207.  
  208. >>> APPEND FROM
  209.  
  210. Beginning with the Developer's Release of dBASE III, APPEND FROM
  211. [DELIMITED] will import delimited files without delimiters. Formerly,
  212. delimited files without delimiters would be erroneously APPENDed into the
  213. current database file.
  214.  
  215.  
  216. >>> APPEND FROM DELIMITED
  217.  
  218. APPEND FROM <Filename> DELIMITED WITH BLANK does not recognize blank fields
  219. and left-justifies the APPENDed data.  When a blank field is APPENDed, the
  220. field is filled with data from the next field in the record.  The data in
  221. the fields following the blank field are shifted into preceding fields. 
  222. Leading blanks are removed from all APPENDed data.  To illustrate,
  223.  
  224.  
  225.      .LIST
  226.      Record#  Field1   Field2   Field3
  227.            1  March    March    March
  228.            2  April             April
  229.            3  May      May        May
  230.            4  June     June      June  
  231.  
  232.     . COPY TO Test TYPE DELIMITED WITH BLANK
  233.     . ZAP
  234.     . APPEND FROM Test TYPE DELIMITED WITH BLANK
  235.     . LIST
  236.      Record#  Field1   Field2   Field3
  237.            1  March    March    March
  238.            2  April    April
  239.            3  May      May      May
  240.            4  June     June     June
  241.  
  242.  
  243. In record 2, the data from Field3 shifted to Field2.  This occurs in both
  244. versions 1.0 and 1.1 of dBASE III PLUS.
  245.  
  246.  
  247. >>> Applications Generator
  248.  
  249. The Applications Generator does not reset the SET commands it changes to
  250. their original values when terminating.  This means that subsequent
  251. operations affected by the status of any SET commmand could be compromised
  252. unless you reset it.  Most noticeably, SET SAFETY is changed to OFF.   
  253.  
  254. The following is a list of the SET commands the Applications Generator
  255. changes and the status when you leave the Applications Generator:
  256.  
  257.    Command     Setting
  258.    -------------------
  259.    BELL        ON
  260.    CONFIRM    ON
  261.    ESCAPE         OFF
  262.    FIELDS         OFF
  263.    HEADINGS    OFF
  264.    SAFETY         OFF
  265.    STATUS         ON
  266.    TALK        ON
  267.  
  268. To workaround this, create a command file that calls the Applications
  269. Generator and then resets the current status of all critical SET commands. 
  270. When you need to run the Applications Generator, DO this command file
  271. instead.
  272.  
  273. This occurs in both versions of dBASE III PLUS.
  274.  
  275.  
  276. >>> ASSIST/RETRIEVE
  277.  
  278. On page L1-24 of the original dBASE III PLUS documentation,
  279. ASSIST Retrieve:List:Construct a field list is incorrectly
  280. documented as displaying an arrow next to selected fields. An
  281. arrow does briefly flash next to the selected fields but does not
  282. remain on screen.
  283.  
  284. The documentation also states that fields can be deselected by
  285. pressing Return on the previously selected field. Selected fields
  286. are dimmed, indicating that they cannot be deselected.
  287.  
  288.  
  289. >>> ASSIST
  290.  
  291. There is no way to close files from ASSIST.  To close files opened in
  292. ASSIST, select ASSIST Set Up:Quit dBASE III, or execute a CLEAR ALL or
  293. appropriate CLOSE command from the dot prompt after leaving ASSIST.
  294.  
  295.  
  296. >>> ASSIST and Subdirectories
  297.  
  298. If you are an ASSIST user, you may have found that you cannot change
  299. directories in ASSIST.  The following program, Subdir.PRG, allows you to
  300. provide support for subdirectories by running ASSIST from a menu that
  301. includes choices for changing directories.
  302.  
  303. Whenever you want to enter ASSIST, type DO Subdir and choose the directory
  304. where you want to work.  When you are situated, choose the option for
  305. ASSIST and away you go.  After you leave ASSIST, you must also quit Subdir
  306. by pressing Esc.  Subdir then CLOSEs all the DATABASES you may have opened.
  307.  
  308. If you want Subdir to come up automatically whenever you bring up dBASE III
  309. PLUS, add the command line
  310.  
  311.   COMMAND=DO Subdir;
  312.  
  313. to your Config.DB file.
  314.  
  315. The program operates by selecting subdirectories from the current default
  316. directory you boot dBASE III PLUS from.  After it loads (this can take some
  317. time), you can move forward to all of the subdirectories under the current
  318. one and back.  You can run ASSIST from any selected subdirectory.
  319.  
  320. Subdir has, in addition, a number of small but significant features.  For
  321. example, it displays the volume label for the current drive.  It has row
  322. and column coordinates that may be modified to change the display location
  323. of the menu window.  It also displays the default directory name, so you
  324. always know where you started.
  325.  
  326. There are some limitations to be aware of:
  327.  
  328. 1. Subdir only displays the first 9 subdirectories it encounters, no matter
  329. how many there are in the default directory.
  330.  
  331. 2. It does not allow the user to navigate anywhere on the disk.
  332.  
  333. 3. It does not display sub-subdirectories.
  334.  
  335.  
  336. Program Code
  337.  
  338.   * Program ...: Subdir.PRG
  339.   * Author ....: Stephen Goodman and Olivier Biggerstaff
  340.   * Date ......: April 1, 1987
  341.   * Note(s) ...: Executes a menu that allows you to change your DOS
  342.   *              directories in association with ASSIST.
  343.   *
  344.   SET TALK OFF
  345.   SET BELL OFF
  346.   SET SAFETY OFF
  347.   SET TITLE OFF
  348.   CLEAR
  349.   *
  350.   * ---This portion creates a database file to hold the
  351.   * ---names of the subdirectories in the current directory.
  352.   @ 12,2 SAY "Reading directory - Please wait"
  353.   RUN DIR > Sysdir.TXT
  354.   SET CATALOG TO Sysdir
  355.   SELECT 10
  356.   COPY STRUCTURE EXTENDED TO Tempfile
  357.   SET CATALOG TO
  358.   SELECT 1
  359.   USE Tempfile
  360.   ZAP
  361.   APPEND BLANK
  362.   REPLACE field_name WITH "Textdata",;
  363.           field_type WITH "C",;
  364.           field_len WITH 80
  365.   USE
  366.   CREATE SYSDIR FROM Tempfile
  367.   APPEND FROM Sysdir.TXT SDF
  368.   DELETE FILE Tempfile.DBF
  369.   DELETE FILE Sysdir.TXT
  370.   DELETE FILE Sysdir.CAT
  371.   *
  372.   * ---The drive and volume label are saved to variables.
  373.   GOTO 2
  374.   drive = SUBSTR(Textdata, 18, 1) + ":"
  375.   title = TRIM("Available Directories" + ;
  376.             IIF(SUBSTR(Textdata, 23, 1) = " ", "", " for " + ;
  377.                 SUBSTR(Textdata, 23)))
  378.   *
  379.   * ---The current directory is the default.
  380.   GOTO 3
  381.   d_default = drive + TRIM(SUBSTR(Textdata, 18))
  382.   *
  383.   * ---Delete all non-subdirectory entries.
  384.   DELETE FOR SUBSTR(Textdata, 1, 1) = ".";
  385.         .OR. SUBSTR(Textdata, 14, 5) <> "<DIR>"
  386.   PACK
  387.   *
  388.   * ---Read the database file into memory variables.
  389.   dot = .F.
  390.   GOTO TOP
  391.   DO WHILE .NOT. EOF()
  392.      datanum      = LTRIM(STR(RECNO()))
  393.      data&datanum = SUBSTR(Textdata, 1, 8)
  394.      IF SUBSTR(Textdata, 10, 1) <> " "
  395.         data&datanum = data&datanum + "." + SUBSTR(Textdata, 10, 3)
  396.         dot = .T.
  397.      ENDIF
  398.      SKIP
  399.   ENDDO
  400.   *
  401.   * ---The maximum number of subdirectories is 9.
  402.   maximum = LTRIM(STR(MIN(9, RECCOUNT())))
  403.   USE
  404.   DELETE FILE Sysdir.DBF
  405.   maxlength = LEN(d_default) + 11 + IIF(dot, 0, 4)
  406.   maxlength = MAX(LEN(title), maxlength) + 6
  407.   line = CHR(199) + REPLICATE(CHR(196), maxlength - 2) + CHR(182)
  408.   default = .T.
  409.   choice  = " "
  410.   mchoice = " "
  411.   DO WHILE .T.
  412.      choice = " "
  413.      CLEAR
  414.      row = 6
  415.      col = 4
  416.          *
  417.      * ---Draw a double lined box with 2 lines in it.
  418.      @  row - 2, col - 3 TO VAL(maximum) + 12, maxlength DOUBLE
  419.      @  row + 1, col - 3 SAY line
  420.      @  row - 1, col     SAY title
  421.          *
  422.      * ---If there are no subdirectories, say so.
  423.      IF maximum = "0"
  424.         @ row, col SAY "None in "+d_default
  425.      ELSE
  426.         @ row + 5, col - 3 SAY line
  427.         @ row, col - 1     SAY IIF(default, CHR(175), " ") + "Default is " +
  428.   d_default
  429.      ENDIF
  430.      @ row + 2, col SAY "A. Run ASSIST"
  431.      @ row + 3, col SAY "B. Go to Default"
  432.      @ row + 4, col SAY "E. Exit"
  433.          *
  434.      * ---Display the subdirectory names in the box.
  435.      datanum = "1"
  436.      DO WHILE datanum <= maximum
  437.         @ row + VAL(datanum) + 5, col SAY datanum + ". Directory " +
  438.   data&datanum
  439.         datanum = LTRIM(STR(VAL(datanum) + 1))
  440.      ENDDO
  441.      IF .NOT. default .AND. mchoice $ "123456789"
  442.         @ row + VAL(mchoice) + 5, col - 1 SAY CHR(175)
  443.      ENDIF
  444.      @ row + VAL(datanum) + 7, col SAY "Enter selection: "
  445.      choice = " "
  446.      mcol = COL()
  447.      DO WHILE .NOT. (choice $ "ABE" .OR. (choice >= "1" .AND. choice <=
  448.   maximum))
  449.         choice = " "
  450.         @ row + VAL(datanum) + 7,mcol + 1 GET choice;
  451.                                           PICTURE "!"
  452.         READ
  453.      ENDDO
  454.          *
  455.      * ---Change directory, run ASSIST, or exit to dBASE III PLUS.
  456.      DO CASE
  457.      CASE choice = "A"
  458.         ASSIST
  459.      CASE choice = "B"
  460.         CLEAR
  461.         RUN CD &d_default
  462.         default = .T.
  463.      CASE choice = "E"
  464.         EXIT
  465.      CASE choice >= "1" .AND. choice <= maximum
  466.         mchoice = choice
  467.         CLEAR
  468.         d_choice = data&choice
  469.         IF LEN(d_default) = 3
  470.            RUN CD \&d_choice
  471.         ELSE
  472.            RUN CD &d_default\&d_choice
  473.         ENDIF
  474.         default = .F.
  475.     ENDCASE
  476.   ENDDO
  477.   *
  478.   * ---Close up and return to the default directory.
  479.   CLEAR
  480.   CLOSE DATABASES
  481.   RUN CD &d_default
  482.   SET TALK ON
  483.   SET SAFETY ON
  484.   SET TITLE ON
  485.   RETURN
  486.   * EOP Subdir.PRG
  487.  
  488.  
  489.  
  490. >>> ASSIST
  491.  
  492. In ASSIST, it is not possible to specify the .NOT. (or FALSE) of
  493. a logical field in a search condition. When a logical field is
  494. specified as the search condition, ASSIST uses .T. as the search
  495. condition. This is true of versions 1.0 and 1.1 of dBASE III
  496. PLUS.
  497.  
  498.  
  499.  
  500. >>> ASSIST
  501.  
  502. 1. In any of the submenus of the Update, Position, Retrieve, or
  503.    Organize menus that support the building of search conditions, when
  504.    building a condition for a date type field, non-date entries are
  505.    accepted as an argument for the CTOD() function without an error
  506.    message.  In the Developer"s Release and earlier versions this would
  507.    fail to locate any date field.  But since the CTOD() function in dBASE
  508.    III PLUS converts non-date entries to blank dates, searching for
  509.    non-date entries on date fields with dBASE III PLUS will position the
  510.    record pointer at the first blank date encountered.  If there are no
  511.    blank dates in the database file, dBASE III PLUS will not locate any
  512.    records.
  513.  
  514. 2. With versions of dBASE III greater than 1.1, it is not possible to build
  515.    a search condition for blank spaces from ASSIST.  The Developer"s
  516.    Release would return the user to ASSIST without comment when this was
  517.    attempted.  dBASE III PLUS will attempt to execute the command.
  518.    However, when it constructs the command line, blank spaces are
  519.    excluded.  For example, requesting ASSIST to
  520.  
  521.       LIST FOR <Field> = "    "
  522.  
  523.    actually executes:
  524.  
  525.      LIST FOR <Field> = ""
  526.  
  527.  
  528.  
  529.    Since all conditions are true when compared to a null string, this is
  530.    identical to:
  531.  
  532.       LIST ALL
  533.  
  534.  
  535. >>> BROWSE
  536.  
  537. The Ctrl-Home and F10 keys behave slightly differently in BROWSE.
  538. Both keys call the menu bar to the screen, but only Ctrl-Home
  539. removes it. This is true of both versions of dBASE III PLUS.
  540.  
  541.  
  542.  
  543. >>> BROWSE
  544.  
  545. BROWSE is extremely slow paging through a database file if the
  546. file is indexed and the index contains many identical entries.
  547. The wait to move from one page to the next is better measured in
  548. minutes than seconds and may appear to have locked the machine.
  549. The amount of time necessary is proportional to the amount of
  550. records with identical keys in the index file. This occurs in
  551. both versions of dBASE III PLUS.
  552.  
  553.  
  554.  
  555. >>> BROWSE
  556.  
  557. The status bar is a part of BROWSE and cannot be removed with SET
  558. STATUS OFF. The state of the status bar prior to BROWSE is
  559. restored when BROWSE is exited. 
  560.  
  561.  
  562. >>> CALL
  563.  
  564. Including the memory variable alias (M->) in the WITH clause of the CALL
  565. command returns the error message "Not a character expression." if the data
  566. type of the memory variable you pass is numeric.  The variable is passed
  567. correctly if the M-> alias is not included.  Since, however, CALL...WITH
  568. assumes a character expression or a memory variable of any type, when you
  569. pass a memory variable and a field with the same name exists, dBASE III
  570. PLUS always passes the memory variable reference to the WITH clause.
  571.  
  572. This occurs in both versions of dBASE III PLUS.
  573.  
  574.  
  575. >>> CASE
  576.  
  577. When using the CASE structure to branch control within your command files,
  578. there are two distinct behaviors if the either the DO CASE or ENDCASE
  579. statements are missing from the construct.
  580.  
  581. 1. If a CASE statement is not preceded by a DO CASE statement, commands
  582.    following the CASE statement and preceding the ENDCASE statement will
  583.    not execute.  In the following example, the LIST and WAIT commands do
  584.    not execute but the DISPLAY MEMORY statement does.
  585.  
  586.      DO WHILE .T.
  587.         USE Test
  588.         CASE
  589.            LIST  <--------|
  590.            WAIT  <--------| Commands do not execute.
  591.        ENDCASE
  592.        DISPLAY MEMORY  <---------- Command executes.
  593.      ENDDO
  594.  
  595. 2. A CASE structure without a terminating ENDCASE will terminate execution
  596.    of a command file and return control to the dot prompt without an error
  597.    message when the first true CASE statement executes.
  598.  
  599.  
  600. >>> CHR(0) to Printer
  601.  
  602. BY CHUCK LITZELL
  603.  
  604. dBASE III PLUS is unable to send CHR(0) to the printer. Since
  605. dBASE uses CHR(0) internally to mark the end of strings, it
  606. processes right up to, but does not include, the CHR(0).
  607.  
  608. This is a problem only if you need to send control codes that
  609. include CHR(0) to the printer. Many printers ignore the high bit
  610. when processing escape codes. Therefore, sending CHR(128) in
  611. place of CHR(0) might work because CHR(128) is the equivalent of
  612. CHR(0) with bit seven turned on.
  613.  
  614. If CHR(128) does not produce the desired results with your
  615. printer, however, you can use the following DEBUG script to
  616. create a .BIN file that will send CHR(0) to your printer. Using a
  617. text editor or the dBASE MODIFY FILE command, create a text file,
  618. named Prnull.DBG, with the lines that follow. Note the empty line
  619. five lines from the bottom; it's important!
  620.  
  621.    N    PRNULL.BIN
  622.    A    100
  623.    PUSH AX
  624.    PUSH DX
  625.    XOR  DX, DX
  626.    MOV  AX, 0500
  627.    INT  21
  628.    POP  DX
  629.    POP  AX
  630.    RETF
  631.    
  632.    RCX
  633.    C
  634.    W
  635.    Q
  636.  
  637.  
  638. To create Prnull.BIN, you must have access to DEBUG.COM, which
  639. you will find on your DOS Supplemental Program diskette. Change
  640. to the drive and directory in which you want to create Prnull.BIN
  641. and enter
  642.  
  643.    DEBUG < Prnull.DBG
  644.  
  645. This command will create Prnull.BIN. If you don't get the DOS
  646. prompt rather quickly, there is an error in your DEBUG script.
  647. Press Return until you see a dash (DEBUG's prompt), and type Q 
  648. and then press Return to quit DEBUG. When Prnull.BIN has been
  649. successfully created you can erase Prnull.DBG.
  650.  
  651. Using Prnull.BIN from within dBASE III PLUS is simple. First LOAD
  652. Prnull. Any time you need to print a CHR(0), just CALL Prnull.
  653. The following example sets the form length to seven inches on an
  654. Epson FX-80 printer. 
  655.  
  656.    * Set Form Length to 7 inches
  657.    *      on Epson FX-80 printer
  658.    * (ESC C NUL 7)
  659.    LOAD Prnull
  660.    SET PRINT ON
  661.    SET CONSOLE OFF
  662.    ?? CHR(27) + "C"
  663.    CALL Prnull
  664.    ?? CHR(7)
  665.    SET PRINT OFF
  666.    SET CONSOLE ON
  667.    RELEASE MODULE Prnull
  668.  
  669.  
  670.  
  671. >>> CHR()
  672.  
  673. CHR(138) and CHR(141), "è" and "ì" respectively, produce
  674. unexpected results when displayed on the screen and cause .PRG
  675. files containing these characters to appear corrupted when edited
  676. with MODIFY COMMAND.  Displaying CHR(138) causes the rest of the
  677. characters on that line to be suppressed.  CHR(141) displays
  678. following characters on the next line.  This occurs because dBASE
  679. III PLUS interprets CHR(138) and CHR(141) as a linefeed and a
  680. carriage return, respectively.
  681.  
  682. The dBASE III PLUS MODIFY COMMAND editor strips off the eighth
  683. data bit of all characters except CHR(141) when files are
  684. loaded.  When CHR(138) is loaded into MODIFY COMMAND, it is
  685. transformed into CHR(10).  Because CHR(10) is the MODIFY COMMAND
  686. end-of-line marker, data after the CHR(138) is not displayed. 
  687. Executing a program file that formerly contained CHR(138)
  688. produces various errors when executed, depending on the command
  689. affected.  When CHR(141) is loaded into the editor, characters
  690. following are displayed on the next line and the line status, on
  691. the right side of the screen, reveals that the line is
  692. continued.  The CHR(141) remains in the file unless it is deleted
  693. or overwritten.  This occurs in both versions 1.0 and 1.1 of
  694. dBASE III PLUS.  
  695.  
  696.  
  697. >>> CLEAR
  698.  
  699. CLEAR is incorrectly documented on page U5-50 of the original
  700. documentation as positioning the cursor in the upper left-hand
  701. corner of the screen at coordinates 0,0. CLEAR positions the
  702. cursor to the lower left-hand corner of the screen at coordinates
  703. 24,0 if SET STATUS is OFF, or coordinates 21,0 if SET STATUS is
  704. ON.
  705.  
  706.  
  707. >>> Compaq 386 DOS
  708.  
  709. Running dBASE III PLUS on a Compaq 386 requires Compaq 386 DOS, not
  710. standard MS-DOS.  To check whether a machine is running Compaq 386 DOS,
  711. enter the DOS MODE command at the operating system using the AUTO parameter
  712. (a valid parameter of Compaq 386 DOS only).  For example, at the operating
  713. system, type
  714.  
  715.        C> MODE AUTO
  716.  
  717. If the error message "Invalid parameter" is returned, the machine is running
  718. the wrong version of DOS.  Running the wrong DOS may cause problems with
  719. system I/O.
  720.  
  721.  
  722. >>> CONFIG.DB
  723.  
  724. The Command section of the original Using dBASE III PLUS manual
  725. says, "SET STATUS is normally ON."  However, STATUS actually
  726. defaults to OFF unless STATUS=ON is included in the CONFIG.DB
  727. file. The CONFIG.DB file included with the original dBASE III
  728. PLUS disks contains the line STATUS=ON.
  729.  
  730.  
  731. >>> CONFIG.DB
  732.  
  733. Using the keyword COMMAND in the CONFIG.DB or loading dBASE III PLUS with
  734. DBASE <Filename> alters the initial sign on.  If this keyword is not
  735. included in the CONFIG.DB file and the command DBASE is used to call the
  736. program up, dBASE III PLUS will display the license agreement on the screen
  737. and immediately present the dot prompt.  However, if COMMAND = <command> is
  738. included in CONFIG.DB or if dBASE III PLUS is invoked with a command
  739. filename on the DOS command line, the sign-on message will remain on the
  740. screen for approximately ten seconds or until Return is pressed before
  741. executing the command from CONFIG.DB or DOing the specified file.
  742.  
  743.  
  744. >>> COPY STRUCTURE EXTENDED
  745.  
  746. Sometimes you may want to make a copy of a database file structure without
  747. making an exact duplicate as you would with the COPY STRUCTURE command.  As
  748. a typical situation, you might have database file that is usable, but you
  749. think has a corrupted header.  You would like to COPY the database file
  750. with a new header and not have to recreate the structure by hand.  With
  751. COPY STRUCTURE EXTENDED, this task can be accomplished quite easily. The
  752. following block of code shows just exactly how.
  753.  
  754.    * ---Create new file.
  755.    USE <old file>
  756.    COPY STRUCTURE EXTENDED TO <extended file>
  757.    CLOSE DATABASE
  758.    CREATE <new file> FROM <extended file>
  759.    * ---COPY old file data to new file.
  760.    USE <new file>
  761.    APPEND FROM <old file>
  762.    CLOSE DATABASE
  763.  
  764. 1. Description
  765.  
  766. dBASE III PLUS and its predecessors, the Developer's Release, version 1.1,
  767. and version 1.0, do not allow you to COPY a DELIMITED file without
  768. delimiters and commas separating fields. Using the WITH BLANK option, you
  769. can get an text file without delimiters but you also get a text file
  770. without commas separating fields.  A standard delimited file looks like
  771. this:
  772.  
  773.    "field1","field2",12,.T.
  774.    ^      ^         ^
  775.    |      |         |
  776.    |      |          ----------- Field separator.
  777.     ---------------------------- Delimiter that bounds character
  778.  
  779. fields.
  780.  
  781. If the external processor that you are interfacing only supports comma
  782. separated text files without delimiters, you can use the following command
  783. file to create one.  The resulting text file will be in the following form:
  784.  
  785.    field1,field2,12,.T.
  786.  
  787. To run this program, type the following command line in a command file or
  788. at the dot prompt:
  789.  
  790.         DO Cpdelim WITH "<database filename>","<index filename>",;
  791.                                 "<filter condition>","<output filename>"
  792.  
  793. The resulting file will have a (.TXT) extension.
  794.  
  795. 2. Program Example
  796.  
  797.   * Program ...: Cpdelim.PRG 
  798.   * Author ....: Christopher White 
  799.   * Date ......: May 1, 1986 
  800.   * Note(s) ...: Program to COPY to a DELIMITED file without delimiters. 
  801.   * 
  802.   PARAMETERS dbf, ndx, condition, txtfile 
  803.   * ---Set environment. 
  804.   SET TALK OFF 
  805.   SET SAFETY OFF 
  806.   * ---Open database file to copy and define the working set of 
  807.   * ---records. 
  808.   filexp = dbf + IIF("" <> TRIM(ndx)," INDEX " + ndx,"") 
  809.   USE &filexp
  810.   SET FILTER TO &condition 
  811.   GO TOP 
  812.   * ---Create a structure extended file. 
  813.   COPY STRUCTURE EXTENDED TO Temp 
  814.   SELECT B 
  815.   USE Temp 
  816.   * ---Find the last field is that not a memo field. 
  817.   lastrec = RECCOUNT() 
  818.   GO BOTTOM 
  819.   DO WHILE Field_type = "M" .AND. (.NOT. BOF())
  820.      lastrec = lastrec - 1
  821.      SKIP -1 
  822.   ENDDO 
  823.   * ---Open output text file. 
  824.   SET ALTERNATE TO &txtfile 
  825.   SET ALTERNATE ON 
  826.   * ---Output records. 
  827.   SELECT A 
  828.   DO WHILE .NOT. EOF()
  829.      SELECT B
  830.      GO TOP
  831.      * ---Output fields.
  832.      DO WHILE .NOT. EOF()
  833.         fld_nme = TRIM("A->" + Field_name)
  834.         DO CASE
  835.         CASE field_type = "C"
  836.            * ---Character field.
  837.            ?? TRIM(&fld_nme)
  838.         CASE field_type = "D"
  839.            * ---Date field.
  840.            ?? STR( YEAR(&fld_nme),4 ) +;
  841.               RIGHT( STR(100 + MONTH(&fld_nme),3),2 ) +;
  842.               RIGHT( STR(100 +   DAY(&fld_nme),3),2 )
  843.         CASE field_type = "N"
  844.            * ---Numeric field.
  845.            ?? LTRIM(STR(&fld_nme,Field_len,Field_dec))
  846.         CASE field_type = "L"
  847.            * ---Logical field.
  848.            ?? &fld_nme
  849.         ENDCASE
  850.         * ---Insert field separator.
  851.         ?? IIF(RECNO() = lastrec,"",",")
  852.         SKIP
  853.      ENDDO
  854.      * ---Insert record separator.
  855.      ?
  856.      * ---Get next output record.
  857.      SELECT A
  858.      SKIP 
  859.   ENDDO 
  860.   * ---Clean up. 
  861.   CLOSE ALTERNATE 
  862.   CLOSE DATABASES 
  863.   ERASE Temp.DBF
  864.   RETURN 
  865.   * EOP Cpdelim.PRG
  866.  
  867.  
  868. >>> CREATE LABEL
  869.  
  870. The correct upper limit for Options:Labels across page is 5, not 15 as
  871. documented on pages  L6-19 and U5-64 of the dBASE III PLUS documentation. 
  872. This is corrected in the second  edition.
  873.  
  874.    Elapsed. PRG
  875.   * Program ....: Elapsed.PRG
  876.   * Author .....: Chuck Litzell
  877.   * Date .......: October 1, 1987
  878.   * Version ....: dBASE III Plus 
  879.   * Note(s) ....: Calculates elapsed time between a starting date and time
  880.   *               and an ending date and time.
  881.   *               Returns result in fifth parameter as a character string in
  882.   *               the format HH:MM:SS
  883.   *
  884.   *               The program is called with the following syntax:
  885.   *
  886.   *                 DO Elapsed WITH sdate, stime, edate, etime, result
  887.   *
  888.   *                 sdate   ::= starting date, date expression
  889.   *                 stime   ::= starting time as HH:MM:SS;
  890.   *                             character expression
  891.   *                 edate   ::= ending date, date expression
  892.   *                 etime   ::= ending time as HH:MM:SS;
  893.   *                             character expression
  894.   *                 result  ::= character memvar, difference is stored
  895.   *                             in this variable as HH:MM:SS
  896.   *
  897.   PARAMETERS sdate, stime, edate, etime, result
  898.   * ---Proportion of a day for an hour, minute and second.
  899.   hour = 1 / 24
  900.   min  = hour / 60
  901.   sec  = min / 60
  902.   
  903.   * ---Get starting date + time in dstart.
  904.   dstart = sdate + VAL(stime) * hour +;
  905.                    VAL(SUBSTR(stime, AT(":", stime) + 1, 2)) * min +;
  906.                    VAL(RIGHT(stime, 2)) * sec
  907.   
  908.   * ---Get ending date + time in dend.
  909.   dend = edate + VAL(etime) * hour +;
  910.                  VAL(SUBSTR(etime, AT(":", etime) + 1, 2)) * min +;
  911.                  VAL(RIGHT(etime, 2)) * sec
  912.   
  913.   timedif = ABS(dend - dstart)
  914.   result  = IIF(dend < dstart, "-", "")
  915.   rhour   = INT(timedif / hour)
  916.   rmin    = INT((timedif - rhour * hour) / min)
  917.   rsec    = ROUND((timedif - rhour * hour - rmin * min) / sec,0)
  918.   result  = result + LTRIM(STR(rhour)) + ":" +;
  919.                      RIGHT(STR(rmin + 100, 3), 2) + ":" +;
  920.                      RIGHT(STR(rsec + 100, 3), 2)
  921.   RETURN
  922.   * ---EOP: Elapsed.PRG.
  923.   
  924.   
  925.   Projtime.PRG
  926.   * Program ....: Projtime.PRG
  927.   * Author .....: Chuck Litzell
  928.   * Date .......: October 1, 1987
  929.   * Version ....: dBASE III Plus Versions, 1.0 and 1.1
  930.   * Note(s) ....: Calculates future date and time by adding a number of
  931.   *               days, hours, minutes and seconds to a given date and time.
  932.   *
  933.   *               The program is called with the following syntax:
  934.   *
  935.   *                 DO Projtime WITH sdate, stime, days, timex, rdate, rtime
  936.   *
  937.   *                 sdate   ::= starting date, date expression
  938.   *                 stime   ::= starting time as HH:MM:SS;
  939.   *                             character expression
  940.   *                 days    ::= number of days to add
  941.   *                 timex   ::= time to add expressed as HH:MM:SS;
  942.   *                             character expression
  943.   *                 rdate   ::= date memvar, receives calculated future date
  944.   *                 rtime   ::= character memvar, receives calculated
  945.   *                             future time expressed as HH:MM:SS
  946.   *
  947.   *
  948.   PARAMETERS sdate, stime, days, timex, rdate, rtime
  949.   
  950.   * ---Proportion of a day for an hour, minute and second.
  951.   hour = 1 / 24
  952.   min  = hour / 60
  953.   sec  = min / 60
  954.   
  955.   * ---Get starting date and time in dwork.
  956.   dwork = sdate + VAL(stime) * hour +;
  957.                   VAL(SUBSTR(stime, AT(":", stime) + 1, 2)) * min +;
  958.                   VAL(RIGHT(stime, 2)) * sec
  959.   
  960.   * ---Add days and time offset.
  961.   dwork = dwork + days + ;
  962.                   VAL(timex) * hour +;
  963.                   VAL(SUBSTR(timex, AT(":", timex) + 1, 2)) * min +;
  964.                   VAL(RIGHT(timex, 2)) * sec
  965.   
  966.   * ---Store integer portion of ending date in rdate.
  967.   * ---This construct removes the decimals that have
  968.   * ---been added to rdate.
  969.   rdate = CTOD(DTOC(dwork))
  970.   
  971.   * ---Get decimal portion of ending date in twork.
  972.   twork = dwork - rdate
  973.   
  974.   * ---Convert twork to a character string.
  975.   rhour = INT(twork / hour)
  976.   rmin  = INT((twork - rhour * hour) / min)
  977.   rsec  = ROUND((twork - rhour * hour - rmin * min) / sec, 0)
  978.   rtime = LTRIM(STR(rhour)) + ":" +;
  979.           RIGHT(STR(rmin + 100, 3), 2) + ":" +;
  980.           RIGHT(STR(rsec + 100, 3), 2)
  981.   RETURN
  982.   * ---EOP: Projtime.PRG.
  983.  
  984.  
  985. >>> CREATE FROM
  986.  
  987. The CREATE FROM command is used to create a database file from a database
  988. file that contains the target database file structure as records.  This a
  989. very useful but not well understood aspect of dBASE III PLUS.  It can be
  990. used as a vehicle for transferring file structures from other processors
  991. such as spreadsheets, word processors, and mainframes.  As an example, your
  992. mainframe consultant could add the target dBASE III database file structure
  993. as a delimited file to the download package he sends you.  It then would be
  994. an easy matter to CREATE the target database file structure FROM the
  995. extended structure definition, and then APPEND FROM the downloaded
  996. delimited data file.  Quite nicely this would free you from knowing or
  997. having to CREATE the target database file structure yourself.
  998.  
  999. If this prospect intrigues you, the structure of the delimited extended
  1000. file must be as follows:
  1001.  
  1002.    Field  Field Name  Type       Width    Dec
  1003.        1  Field_name  Character     10
  1004.        2  Field_type  Character      1
  1005.        3  Field_len   Numeric        3
  1006.        4  Field_dec   Numeric        3
  1007.    ** Total **                      28
  1008.  
  1009. Each record of the delimited extended file must have fields equivalent to the
  1010. one listed above.  The file should be a standard delimited file obeying all the
  1011. rules of the delimited file structure.  The following demonstrates what a
  1012. typical delimited extended file looks like.
  1013.  
  1014.           ---------------- Field name
  1015.                 |       --------- Data type
  1016.          |      |    ----- Field length
  1017.          |      |   |
  1018.          v      v   v v -- Number of decimal places if numeric
  1019.    "Field_one","C",15
  1020.    "Field_two","N",10,2
  1021.  
  1022. To import this structure into dBASE III PLUS and translate it into a database
  1023. file structure, perform the following steps.
  1024.  
  1025.    * ---Create mechanism for structure translation.
  1026.    USE <any file>
  1027.    COPY STRUCTURE EXTENDED TO Temp
  1028.    USE Temp
  1029.    ZAP
  1030.    * ---Bring the structure to translate into the mechanism.
  1031.    APPEND FROM <your structure> DELIMITED
  1032.    USE
  1033.    * ---Translate your structure into a database file.
  1034.    CREATE <your file> FROM Temp
  1035.    ERASE Temp.DBF
  1036.  
  1037.  
  1038. >>> CREATE REPORT
  1039.  
  1040. In CREATE REPORT, the Columns:Decimal places value defaults to
  1041. the number of decimal places specified by SET DECIMALS TO when
  1042. SET FIXED is ON; ignoring the number of decimal places specified
  1043. in the file structure. The documentation for CREATE REPORT
  1044. incorrectly states that the Columns:Decimal places value defaults
  1045. to the number of decimal places specified in the file structure.
  1046. This is true of both versions of dBASE III PLUS.
  1047.  
  1048.  
  1049.  
  1050.  
  1051. ==============================
  1052.  
  1053.    CTOOLS SECTION
  1054.  
  1055. >>> Array Save and Restore [cTools Programmers Library]
  1056.  
  1057. The Graphics Library uses a binary save of an array, unlike The Programmer's
  1058. Library, which uses a text save.  The dBASE Tools for C Incentive Disk allows
  1059. you to use a text save with The Graphics Library.
  1060.  
  1061.  
  1062. >>> Linking the Graphics Library [cTools Programmers Library]
  1063.  
  1064. There have been several requests either to include portions of the Graphics
  1065. Library in the Programmer's Library at link time or exclude portions of the
  1066. Graphics Library that require source code.  Neither one is possible but you
  1067. can load both libraries at once as long as you have 640K of memory.
  1068.  
  1069.  
  1070. >>> Scaling [cTools Programmers Library]
  1071.  
  1072. The Graphics Library does not currently include parameters to allow manual Y
  1073. axis scaling (as in Framework II).  You can, however, write a dBASE III PLUS
  1074. using the low-level graphic functions to draw a graph.
  1075.  
  1076.  
  1077.    END CTOOLS SECTION
  1078.  
  1079. ==============================
  1080.  
  1081.  
  1082. >>> Date Fields
  1083.  
  1084. The date data type uses the Gregorian system of timekeeping in that only
  1085. those centesimal  years divisible by 400 are leap years. See the table at
  1086. right for examples. This is true for every  version of dBASE III PLUS.
  1087.  
  1088.   Year      Number of Days
  1089.   2000      366
  1090.   1900      365
  1091.   1800      365
  1092.   1700      365
  1093.   1600      366
  1094.   1500      365
  1095.  
  1096.  
  1097. >>> Date and Time Calculations
  1098.  
  1099. BY CHUCK LITZELL
  1100.  
  1101. dBASE III PLUS stores Date data types differently in memory variables than
  1102. in database  fields.  In a database field, dates are stored as eight digits
  1103. in the format YYYYMMDD.   When a date is stored to a memory variable,
  1104. however, it is stored as a floating point  number.  The actual value stored
  1105. is an offset, in days, from a base date.  This method of  representing
  1106. dates makes date math possible.
  1107.  
  1108. Since a date memory variable is a floating point number, it should be
  1109. possible to store  decimals to the date as well as integers.  Typing these
  1110. lines at the dot prompt confirms this:
  1111.  
  1112.   . mdate = DATE()
  1113.   . ? mdate
  1114.   10/01/87
  1115.   . mdate = mdate + .5
  1116.   . ? mdate
  1117.   10/01/87
  1118.   . mdate = mdate + .5
  1119.   . ? mdate
  1120.   10/02/87
  1121.  
  1122. Adding .5 to mdate increments the date by one-half day, or 12 hours. 
  1123. Adding it a second  time advances the date to the next day.  Applications
  1124. that need to perform date and time  calculations can take advantage of this
  1125. additional capacity of date memory variables.   The procedures, Elapsed.PRG
  1126. (Figure 1) and Projtime.PRG (Figure 2), demonstrate how  times, represented
  1127. as a fraction of a day, can be combined with date memory variables in 
  1128. calculations.  Elapsed calculates the elapsed time between two dates and
  1129. times, and Projtime  calculates the date and time after a given increment
  1130. to a given date and time.
  1131.  
  1132. Both procedures accept dates and times as input parameters.  Times are
  1133. represented as  character strings in a format similar to the result of the
  1134. TIME() function, except that the  number of hours may be more than two
  1135. digits.  "12:30:15," "1:00:05," and "4521:18:37" are  all handled correctly
  1136. by these procedures. However, "12:5:5," "7:30," and "18:12:5," are not 
  1137. valid.  The minutes and days must be two digits, and there must be two
  1138. colons appropriately  positioned within the string. Here's an example of
  1139. how to use Elapsed:
  1140.  
  1141.   mtime = ""
  1142.   DO Elapsed WITH CTOD("10/01/87"), "12:15:45",;
  1143.      CTOD("12/13/87"),  "17:00:00", mtime
  1144.   ? mtime
  1145.   1756:44:15
  1146.   and here's an example of how to use Projtime:
  1147.   mdate = CTOD("  /  /  ")
  1148.   mtime = ""
  1149.   DO Projtime WITH CTOD("12/31/87"), "23:59:59",;
  1150.      0, "00:00:01", mdate, mtime
  1151.   ? mdate, mtime
  1152.   01/01/88 0:00:00
  1153.  
  1154.  
  1155. >>> dBCODE
  1156.  
  1157. dBCODE does not trap illegal characters in filenames when
  1158. encoding command files.  Executing a dBCODEd command file that
  1159. references an illegal filename produces the error message
  1160. "Unrecognized phrase/keyword in command." [36] or "File does not
  1161. exist." [1].
  1162.  
  1163.  
  1164. >>> .DBF File Header
  1165.  
  1166. The dBASE III PLUS database file header is one byte shorter than that
  1167. created by all other versions of dBASE III.  Earlier versions put an
  1168. "extra" byte (00H) between the header and the beginning of the data.  dBASE
  1169. III PLUS no longer includes this byte and the data begins immediately
  1170. following the last byte of the header (0DH).  The number of bytes in the
  1171. header (bytes 8 and 9) reflect the smaller header size.
  1172.  
  1173. dBASE III PLUS has no problem reading files from earlier versions as long
  1174. as bytes 8 and 9 correctly reflect the actual size of the header.
  1175.  
  1176. This procedure will create a file one byte smaller than the original file:
  1177.  
  1178.   * ---This is a 1.1 created file.
  1179.   USE Test
  1180.   COPY TO Test1
  1181.   DIR                && Test1 is one byte smaller than Test.
  1182.  
  1183.  
  1184. >>> Demonstration Disk (RunTime+)
  1185.  
  1186. In the Developer's Release of dBASE III, the dBRUN programs from the
  1187. Demonstration Disk are not compatible with the full system. Code crunched
  1188. with DBC.COM from the Demonstration Disk can only be run with dBRUN from
  1189. the Demonstration Disk.  Code crunched with DBC.COM from the Developer's
  1190. Disk can only be run with the full dBASE III system or the dBRUN disk,
  1191. purchased separately.
  1192.  
  1193.  The error message:
  1194.  
  1195.      No database is in USE.  Enter filename:
  1196.  
  1197.  is a common indicator that the incorrect dBRUN or dBC is being used.
  1198.  
  1199.  
  1200. >>> DIRECTORY
  1201.  
  1202. DIRECTORY is an undocumented dBASE III PLUS command that performs
  1203. identically to the dBASE DIR command. 
  1204.  
  1205.  
  1206. >>> DO
  1207.  
  1208. dBASE III PLUS allows recursive calls of program files. A program
  1209. can call a subprogram and that subprogram can call the
  1210. originating program until too many files are open.  For example,
  1211.  
  1212.      * A_prog.PRG          * B_prog.PRG
  1213.      DO B_prog             DO A_prog
  1214.  
  1215. A program may also call itself. The following program continues
  1216. to open files until the "Too many files are open." [6] error
  1217. message is returned.
  1218.  
  1219.    * Test.PRG
  1220.    DO Test
  1221.  
  1222. It is possible to do this in all versions of dBASE III PLUS.
  1223.  
  1224.  
  1225. >>> DO <Procedure>
  1226.  
  1227. If you SET PROCEDURE TO a file on a drive other than the default, DO
  1228. <Procedure> requires  that the drive designator not be included in the
  1229. command.  The commands
  1230.  
  1231.   SET PROCEDURE TO A:Test
  1232.   DO A:Test1
  1233.  
  1234. will cause dBASE III to look for the command file Test1.PRG on drive A:. 
  1235. The proper syntax  is
  1236.  
  1237.   SET PROCEDURE TO A:Test
  1238.   DO Test1
  1239.  
  1240. This is true for all versions of dBASE III PLUS. 
  1241.  
  1242.  
  1243. >>> DO WHILE
  1244.  
  1245. In versions of dBASE III earlier than the Developer's Release, the DO WHILE
  1246. command will stop evaluating it's condition as soon as the expression is
  1247. complete, ignoring characters beyond that point.  This makes it possible
  1248. for conditions with a seemingly invalid expression to be executed.  For
  1249. example,
  1250.  
  1251.    DO WHILE EOF() = .T.
  1252.    DO WHILE EOF() = .F.   both equal   DO WHILE EOF()
  1253.  
  1254. and,
  1255.  
  1256.    DO WHILE .T. = EOF()   equals       DO WHILE .T.
  1257.    DO WHILE .F. = EOF()   equals       DO WHILE .F.
  1258.  
  1259. In the Developer's Release and dBASE III PLUS the above conditions will
  1260. return the error message, "Invalid operator."
  1261.  
  1262.  
  1263. >>> Documentation Error
  1264.  
  1265. 1. Page 5-25 of the Networking section of the dBASE III PLUS Reference
  1266. Manual shows the following command line.
  1267.  
  1268.                 CASE ERROR() = 158
  1269.  
  1270. This command is supposed to trap the "File is in use by another"
  1271. condition.  The error number, however, is incorrect and the command line
  1272. should read:
  1273.  
  1274.                 CASE ERROR() = 108
  1275.  
  1276. 2. There are coding errors on pages 4-18, 5-27, and 5-30 of the Networking
  1277. section of the dBASE III PLUS Reference Manual.  The command line,
  1278.  
  1279.                 IF TIME = 250
  1280.  
  1281. purports to test if an attempt to lock a database file failed.  It is not,
  1282. however, a reliable coding method and should be changed to
  1283.  
  1284.                 IF .NOT. FLOCK()
  1285.  
  1286. 3. On page 4-18 of the Networking section of the dBASE III PLUS Reference
  1287. Manual, the command
  1288.  
  1289.                 times = 1
  1290.  
  1291. should be inserted immediately before the SKIP command.  The routine on the
  1292. following page is an error handling routine executed if SKIP encounters a
  1293. locked record and expects the variable, times, to be reset each time it is
  1294. called.
  1295.  
  1296. 4. On page 5-30 of the Networking section of the dBASE III PLUS Reference
  1297. Manual, the UNLOCK command should be placed after the READ command.
  1298.  
  1299.  
  1300. >>> EDIT RECORD <n>
  1301.  
  1302. In dBASE III versions 1.0 and 1.1, EDIT RECORD <n> and EDIT <n> behave
  1303. identically.   They both enter the full-screen edit mode at the record
  1304. indicated.  PgUp and PgDn take the  user to the previous and following
  1305. records respectively.  In the Developer's Release and  dBASEIIIPLUS, EDIT
  1306. <n> acts the same as in version 1.0 and 1.1; however, EDIT RECORD  <n>
  1307. allows editing of the specified record only.  PgUp and PgDn return the user
  1308. to the dot  prompt.  This is true of both versions of dBASE III PLUS.
  1309.  
  1310.  
  1311. >>> EOF()
  1312.  
  1313. When you execute REINDEX or PACK on an indexed database file the the record
  1314. pointer is positioned to the end-of-file and EOF() returns a true (.T.). 
  1315. By contrast, INDEX ON and PACK position the record pointer to the first
  1316. record when used on non-indexed database files.
  1317.  
  1318. This occurs in both versions of dBASE III PLUS.
  1319.  
  1320.  
  1321. >>> ERROR()
  1322.  
  1323. The following error messages cannot be trapped by ON ERROR in any version
  1324. of dBASE III PLUS, although they do return the error number specified.
  1325.  
  1326.    14     No find.
  1327.    25     Record not inserted.
  1328.    39     Numeric overflow (data was lost).
  1329.    49     File has been deleted.
  1330.    52     No database in USE.
  1331.    56     Disk full when writing file:
  1332.    72     ALTERNATE could not be opened.
  1333.    73     ^^ Expected ON or OFF.
  1334.    74     ^--- Truncated.
  1335.    81     Invalid date.
  1336.    82     ** Not Found **
  1337.    86     ^-- Keyword not found.
  1338.    89     Cannot erase a file which is open.
  1339.   113     Index interrupted. Index will be damaged if not completed.
  1340.   129     Unable to LOCK.
  1341.   132     Unauthorized login.
  1342.   144     Unauthorized duplicate.
  1343.   145     Error in configuration value.
  1344.   150     Help text not found.
  1345.  
  1346. The following error message cannot be trapped by ON ERROR in version 1.0 of
  1347. dBASE III PLUS, but can be trapped in version 1.1.
  1348.  
  1349.   149     Master catalog is empty.
  1350.  
  1351.  
  1352. >>> Error Messages
  1353.  
  1354. The error message "Invalid DIF vector - DBF field mismatch [116]" is
  1355. undocumented in the original dBASE III PLUS documentation.  This error
  1356. message occurs when APPENDing FROM a DIF file and data in that file
  1357. conflicts with the DIF header.
  1358.  
  1359.  
  1360. >>> Error Messages by Number
  1361.  
  1362. The following is a list of dBASE III PLUS error messages in numeric order.
  1363.  
  1364.     1 File does not exist.
  1365.     2 Unassigned file no.
  1366.     3 File is already open.
  1367.     4 End-of-file encountered.
  1368.     5 Record is out of range.
  1369.     6 Too many files are open.
  1370.     7 File already exists.
  1371.     8 Unbalanced parenthesis.
  1372.     9 Data type mismatch.
  1373.    10 Syntax error.
  1374.    11 Invalid function argument.
  1375.    12 Variable not found.
  1376.    13 ALIAS not found.
  1377.    14 No find.
  1378.    15 Not a dBASE database.
  1379.    16 *** Unrecognized command verb.
  1380.    17 Cannot select requested database.
  1381.    18 Line exceeds maximum of 254 characters.
  1382.    19 Index file does not match database.
  1383.    20 Record is not in index.
  1384.    21 Out of memory variable memory.
  1385.    22 Out of memory variable slots.
  1386.    23 Index is too big (100 char maximum).
  1387.    24 ALIAS name already in use.
  1388.    25 Record not inserted.
  1389.    26 Database is not indexed.
  1390.    27 Not a numeric expression.
  1391.    28 Too many indices.
  1392.    29 File is not accessible.
  1393.    30 Position is off the screen.
  1394.    31 Invalid function name.
  1395.    33 Structure invalid.
  1396.    34 Operation with Memo field invalid.
  1397.    35 Unterminated string.
  1398.    36 Unrecognized phrase/keyword in command.
  1399.    37 Not a Logical expression.
  1400.    38 Beginning of file encountered.
  1401.    39 Numeric overflow (data was lost).
  1402.    41 .DBT file cannot be opened.
  1403.    42 CONTINUE without LOCATE.
  1404.    43 Insufficient memory.
  1405.    44 Cyclic relation.
  1406.    45 Not a character expression.
  1407.    46 Illegal value.
  1408.    47 No fields to process.
  1409.    48 Field not found.
  1410.    50 Report file invalid.
  1411.    51 End of file or error on keyboard input.
  1412.    52 No database in USE.
  1413.    53 There are no files of the type requested in this drive
  1414.       or catalog.
  1415.    54 Label file invalid.
  1416.    55 Memory Variable file is invalid.
  1417.    56 Disk full when writing file:
  1418.    57 ***Execution error on CHR() : Out of range.
  1419.    58 ***Execution error on LOG() : Zero or negative.
  1420.    59 ***Execution error on SPACE() : Too large.
  1421.    60 ***Execution error on SPACE() : Negative.
  1422.    61 ***Execution error on SQRT() : Negative.
  1423.    62 ***Execution error on SUBSTR() : Start point out of
  1424.          range.
  1425.    63 ***Execution error on STR() : Out of range.
  1426.    65 Internal error : Unknown command code:
  1427.    66 Internal error : CMDSET():
  1428.    67 Internal error : EVAL work area overflow
  1429.    68 Internal error : Illegal opcode.
  1430.    70 ** WARNING ** Data will probably be lost. Confirm (Y/N).
  1431.    72 ALTERNATE could not be opened.
  1432.    73 ^^ Expected ON or OFF.
  1433.    74 ^--- Truncated.
  1434.    75 ^--- Out of range.
  1435.    76 ***Execution error on - : Concatenation string too large.
  1436.    77 ***Execution error on + : Concatenation string too large.
  1437.    78 ***Execution error on ^ or ** : Negative base,
  1438.          fractional exponent.
  1439.    79 ***Execution error on STORE : String too large.
  1440.    81 Invalid date.
  1441.    82 ** Not Found **
  1442.    86 ^-- Keyword not found.
  1443.    87 ***Execution error on NDX() : invalid index number.
  1444.    88 ***Execution error on REPLICATE() : String too large.
  1445.    89 Cannot erase a file which is open.
  1446.    90 Operation with Logical field invalid.
  1447.    91 File was not LOADed.
  1448.    92 Unable to load COMMAND.COM.
  1449.    93 No PARAMETER statement found.
  1450.    94 Wrong number of parameters.
  1451.    95 Valid only in programs.
  1452.    96 Mismatched DO WHILE and ENDDO.
  1453.    99 Invalid DOS SET option.
  1454.   101 Not suspended.
  1455.   102 ***Execution error on STUFF() : String too large
  1456.   103 DOs nested too deep.
  1457.   104 Unknown function key.
  1458.   105 Table is full.
  1459.   106 Invalid index number.
  1460.   107 Invalid operator.
  1461.   108 File is in use by another.
  1462.   109 Record is in use by another.
  1463.   110 Exclusive open of file is required.
  1464.   111 Cannot write to a read-only file.
  1465.   112 Index expression is too big (220 char maximum).
  1466.   113 Index interrupted. Index will be deleted if not completed.
  1467.   114 Index damaged. REINDEX should be done before using data.
  1468.   115 Invalid DIF File Header.
  1469.   116 Invalid DIF vector - DBF field mismatch.
  1470.   117 Invalid DIF Type Indicator.
  1471.   118 Invalid DIF character.
  1472.   119 Invalid SYLK File Header.
  1473.   120 Invalid SYLK Dimension Bounds
  1474.   121 Invalid SYLK File Format.
  1475.   122 Data Catalog has not been established.
  1476.   123 Invalid printer port.
  1477.   124 Invalid printer redirection.
  1478.   125 Printer not ready.
  1479.   126 Printer is either not connected or turned off.
  1480.   127 Not a valid VIEW file.
  1481.   128 Unable to SKIP.
  1482.   129 Unable to LOCK.
  1483.   130 Record is not locked.
  1484.   131 Database is encrypted.
  1485.   132 Unauthorized login.
  1486.   133 Unauthorized access level.
  1487.   134 Not a QUERY file.
  1488.   136 Unsupported path given.
  1489.   137 Maximum record length exceeded.
  1490.   138 No fields were found to copy.
  1491.   139 Cannot JOIN a file with itself.
  1492.   140 Not a PFS file.
  1493.   141 Fields list too complicated.
  1494.   142 Relation record is in use by others.
  1495.   143 Query not valid for this environment.
  1496.   146 Maximum path length exceeded.
  1497.   147 Cannot append in column order.
  1498.   148 Network server busy.
  1499.   149 Master catalog is empty.
  1500.  
  1501. Note also that the following error is not documented.
  1502.  
  1503.   146 Maximum path length exceeded.
  1504.  
  1505.  
  1506. >>> "EVAL Work area" Messages
  1507.  
  1508. The dBASE III PLUS "EVAL work area" is used by any expression in any
  1509. command that allows any type of expression or condition. Commands that
  1510. contain a condition or expression invoke the expression evaluator and use
  1511. the evaluation workarea. The error message "Internal error: EVAL work area
  1512. overflow" occurs when a command is too complex to be evaluated within the
  1513. workarea's allocated space. This is true of all versions of dBASE III PLUS.
  1514.  
  1515.  
  1516.  
  1517. >>> Exclusive .OR.
  1518.  
  1519. dBASE's .OR. is nonexclusive.  In other words, it returns true (.T.) in any
  1520. case except when both conditions you are comparing are false (.F.).  
  1521.  
  1522. Exclusive .OR. (normally called XOR) returns true (.T.) only if the two
  1523. conditions you are comparing are different.  
  1524.  
  1525. To XOR two conditions, you can use the following formula (where term_a and
  1526. term_b represent two logical values):
  1527.  
  1528. ? (term_a .AND. .NOT. term_b) .OR. (.NOT. term_a .AND. term_b)
  1529.  
  1530. The following code fragment prints out all the possible values for XOR:
  1531.  
  1532.  x = "(term_a .AND. .NOT. term_b) .OR. (.NOT. term_a .AND. term_b)"
  1533.  term_a = .T.
  1534.  term_b = .T.
  1535.  ? ".T. XOR .T. = " + IIF(&x,".T.",".F.")
  1536.  term_a = .T.
  1537.  term_b = .F.
  1538.  ? ".T. XOR .F. = " + IIF(&x,".T.",".F.")
  1539.  term_a = .F.
  1540.  term_b = .T.
  1541.  ? ".F. XOR .T. = " + IIF(&x,".T.",".F.")
  1542.  term_a = .F.
  1543.  term_b = .F.
  1544.  ? ".F. XOR .F. = " + IIF(&x,".T.",".F.")
  1545.   The printout shows:
  1546.  
  1547.  .T. XOR .T. = .F.
  1548.  .T. XOR .F. = .T.
  1549.  .F. XOR .T. = .T.
  1550.  .F. XOR .F. = .F.
  1551.  
  1552.  
  1553. >>> "***Execution error on SUBSTR(): Start point out of range."
  1554.  
  1555. If you are using the SUBSTR() function with memory variables or with an
  1556. expression whose value might be null or shorter in length than the starting
  1557. position argument of the SUBSTR() function, you will get the error message
  1558. "***Execution error on SUBSTR(): Start point out of range."  This is not a
  1559. terminal error condition as is the case with a syntax error.  The SUBSTR()
  1560. function terminates gracefully, returning a null as the result.  The
  1561. execution error, however, does present a problem.  If SET CONSOLE is ON and
  1562. the execution error occurs, the error message will echo to the screen,
  1563. disturbing your display.  If SET PRINT is ON or the substring expression is
  1564. part of any command that is sending output with the TO PRINT clause, the
  1565. error message will echo to the printer.  This is particularly a problem
  1566. with REPORT and LABEL FORMs.
  1567.  
  1568. There are three strategies you can use to suppress the display of the error
  1569. message.  The use of each depends on what commands are being used with the
  1570. substring expression.
  1571.  
  1572. 1. If you are assigning memory variables or using @...SAY to send the
  1573. result of the substring expression to the screen or printer, you can SET
  1574. CONSOLE OFF to suppress the error message.
  1575.  
  1576. 2. If you are using a TO PRINT command such as LABEL FORM TO PRINT, use the
  1577. IIF() function as the starting position expression to return a zero if the
  1578. length of the character string is less than the start position you really
  1579. want.  SUBSTR() always returns a null string if the starting position is
  1580. zero.  For example, the following expression returns a null string if the
  1581. length of the memory variable "x" is less than three.
  1582.  
  1583.      SUBSTR(x, IIF(LEN(x) < 3, 0, 3), 6)
  1584.  
  1585. Use a SUBSTR() with this form to suppress the execution error message.
  1586.  
  1587. 3. Lastly, you can use ON ERROR to trap execution errors.  Define the
  1588. argument of the ON ERROR condition as a dummy expression such as,
  1589.  
  1590.       ON ERROR dummy = 0
  1591.  
  1592. before you execute a command that causes the execution error.  Be aware
  1593. that this approach is limited since you may need the ON ERROR condition for
  1594. other purposes.  In addition, branching to a command file in order to trap
  1595. a range of error conditions terminates REPORT or LABEL FORMs.
  1596.  
  1597.  
  1598. >>> EXPORT
  1599.  
  1600. The error messages produced by EXPORT and their causes are not documented. 
  1601. They are  not trapped by ON ERROR.  The messages are
  1602.  
  1603. 1. "Too many @ commands on one page of format file." This error occurs when
  1604. there are  more than 200 @ commands in the format file used for EXPORT.
  1605.  
  1606. 2. "Format files must be in row major order to be exported."  This error
  1607. occurs if the <Row>  and/or <Col> coordinates have values that are less
  1608. than previously given coordinates.  For  example,
  1609.  
  1610.   @ 10,1 SAY 'A'
  1611.   @  5,1 SAY 'B'
  1612.  
  1613. 3. "PFS does not allow row numbers higher than 20."  Any <Row> value higher
  1614. than 20  produces this error.
  1615.  
  1616. This is corrected in the second edition of the documentation. 
  1617.  
  1618.  
  1619. >>> EXP()
  1620.  
  1621. The range of the numeric expression of the EXP() function is between
  1622.  
  1623.    -708.3964185322642 and 709.7827128933841
  1624.  
  1625. Values outside this range exceed the numeric accuracy of dBASE III PLUS and
  1626. produce an internal numeric overflow.  For example, using EXP() to evaluate
  1627. the exponent of the LOG() of a number should return the original value.  In
  1628. the following exmaple, a value outside of the range does return itself.
  1629.  
  1630.    * ---Correct result.
  1631.    ? LOG(EXP(709))
  1632.    709.00
  1633.    
  1634.    * ---Incorrect result.
  1635.    ? LOG(EXP(710))
  1636.    11356.52
  1637.  
  1638. Evaluating the LOG() of the EXP() of a number below -708.3964185322641
  1639. produces the error message "Execution error on LOG() : Zero or negative"
  1640. [58].  
  1641.  
  1642. This occurs in both versions of dBASE III PLUS.
  1643.  
  1644.  
  1645. >>> F1 Key
  1646.  
  1647. The F1 function key can be used to exit an active @...GET if the @...GET is
  1648. not within a format file opened with SET FORMAT TO. Changes made prior to
  1649. pressing F1 are saved as if Ctrl-W were pressed.
  1650.  
  1651. However, even though F1 exits and saves the data, it does not produce
  1652. exit-key values that are consistent with other dBASE III PLUS write
  1653. operations. Write operations always save the data and produce an exit-key 
  1654. value that READKEY() interprets as data changed, regardless of whether data
  1655. have been altered. When F1 is used to exit a full-screen operation,
  1656. READKEY() returns either 36 for no change in data or 292 when data have
  1657. changed. To be consistent, F1 should not produce 36 since it means
  1658. non-updated data.
  1659.  
  1660. Pressing F1 in an active screen format moves the cursor to the beginning of
  1661. the current field without exiting the screen. This occurs in all versions
  1662. of dBASE III PLUS.
  1663.  
  1664.  
  1665.  
  1666. >>> File Extensions
  1667.  
  1668. In Table 1 is a list of default filename extensions created by dBASE III
  1669. PLUS along with  their descriptions and the commands which may be used to
  1670. create them.  Only extensions  that remain on disk once dBASE III PLUS has
  1671. terminated normally are included.  
  1672.  
  1673. Temporary files created, then erased, by dBASE III PLUS are not included.
  1674.  
  1675. Note that DBC.COM and DBL.COM also create files with .PRG extensions.  See
  1676. the Runtime  section of the manual for more information on DBC and DBL.
  1677.  
  1678. When dCONVERT is used to convert dBASE II files, the old file is renamed
  1679. with a "B" for  the last letter of the extension (.??B.)
  1680.  
  1681. Following is a list of commands with their descriptions that create a file
  1682. with no default  extension. 
  1683.  
  1684.   Command        Description
  1685.   
  1686.   EXPORT TO...   Creates a PFS
  1687.   TYPE PFS       file.
  1688.   
  1689.   MODIFY/CREATE  Creates a text
  1690.   FILE           file.
  1691.   
  1692.   COPY TO...     Creates a 
  1693.   TYPE SYLK      Multiplan spreadsheet.
  1694.  
  1695.  
  1696. >>> Floating Dollar Signs
  1697.  
  1698. dBASE III PLUS does not directly support the display of numbers
  1699. right-justified with a floating dollar sign.  To achieve a floating dollar
  1700. sign to either print or display numeric data, you can use the following
  1701. expression.
  1702.  
  1703.   RIGHT(SPACE(<length of number>) + "$" + ;
  1704.         LTRIM(TRANSFORM(<number>, "999,999,999,999.99"), <length of
  1705. number>)
  1706.  
  1707. This expression can be used wherever dBASE III PLUS accepts the result of a
  1708. character expression.  This includes @...SAY, ??, LABEL and REPORT FORMS.
  1709.  
  1710.  
  1711. >>> For 256K Machines
  1712.  
  1713. dBASE III PLUS runs with PC-DOS version 2.xx if you have 256K installed
  1714. memory in your computer.  If you have a minimum of 384K of installed
  1715. memory, dBASE III PLUS runs with PC-DOS version 3.xx as well as version
  1716. 2.xx.
  1717.  
  1718. For 256K operation, two files are provided, CONFI256.SYS and CONFI256.DB,
  1719. on System Disk #1.  These two files set system parameters for maximum
  1720. overall performance of dBASE III PLUS in a 256K environment.
  1721.  
  1722. The CONFI256.SYS file contains:
  1723.  
  1724.    FILES = 20
  1725.    BUFFERS = 4
  1726.  
  1727. Copy the CONFI256.SYS file to the root directory of the disk you boot DOS
  1728. from or the directory set by the DOS COMSPEC command and rename it to
  1729. CONFIG.SYS.  If CONFIG.SYS already exists, modify the file to include FILES
  1730. = 20 and BUFFERS = 4.
  1731.  
  1732. The CONFI256.DB file contains:
  1733.     COMMAND = ASSIST
  1734.     STATUS = ON
  1735.     BUCKET = 1
  1736.     GETS = 35
  1737.     MVARSIZ = 3
  1738.     HISTORY = 10
  1739.     TYPEAHEAD = 10
  1740.  
  1741. Copy CONFI256.DB into be placed in the same directory as DBASE.COM and
  1742. rename it to CONFIG.DB.
  1743.  
  1744. The CONFI256.DB settings reduce the memory-intensive parameters allowing
  1745. dBASE III PLUS to work in a 256K environment.  The smaller settings place
  1746. the following limitations on dBASE III PLUS.
  1747.  
  1748. MVARSIZ is reduced to 3,000 bytes which is half the normal default size of
  1749. 6,000 bytes.  This reduces the amount of space available for memory
  1750. variables and may cause incompatibilities with programs written with
  1751. earlier versions of dBASE III.  Refer to the SAVE and RESTORE commands for
  1752. ways to optimize use of memory variable space.
  1753.  
  1754. BUCKET size is reduced to 1,024 bytes, half the normal default size.  This
  1755. reduces the amount of memory available for the PICTURE and RANGE options of
  1756. the @...GET command, and may cause incompatibilities with programs written
  1757. with earlier versions of dBASE III.
  1758.  
  1759. CREATE SCREEN is limited to one screen, with a maximum of 35 pending GETs.
  1760. Format files created on machines with more memory may not work when moved
  1761. to a 256K machine.  The limitation of 35 pending GETs may also cause
  1762. incompatibilities with programs written with earlier versions of dBASE III.
  1763.  
  1764. The RUN command is not supported on computers with 256K of memory.  dBASE
  1765. III PLUS requires 256K, the RUN command requires additional memory for
  1766. COMMAND.COM plus the memory required by the external program.  This is
  1767. consistent with earlier versions of dBASE III.
  1768.  
  1769. The "Insufficient memory" message is an indication that some memory must be
  1770. released to allow dBASE III PLUS to continue with the operation.  When
  1771. using dBASE III PLUS with 256K RAM this message may result from a
  1772. combination of factors and varies with the size and number of database
  1773. files, index files, format files, and the HISTORY and TYPEAHEAD buffer
  1774. sizes.
  1775.  
  1776. If the "Insufficient memory" message is received:
  1777.  
  1778. 1. Ensure that you are using the correct CONFIG.SYS and CONFIG.DB
  1779.    files, as listed above for 256K operation.
  1780.  
  1781. 2. Close one or more open files and then proceed.
  1782.  
  1783. Increasing the amount of RAM in your computer will significantly enhance
  1784. the performance of dBASE III PLUS.
  1785.  
  1786.  
  1787. >>> GETENV()
  1788.  
  1789. You can use DOS environmental variables to set and hold locational pointers
  1790. to various directories for the purpose of installing application systems. 
  1791. Many modern programs are now so large they require the use of
  1792. subdirectories to control the location of information.  In view of this,
  1793. many use the DOS environmental variable technique to accomplish the needed
  1794. control.
  1795.  
  1796. In order to gain the same power with dBASE III PLUS and your programs, use
  1797. GETENV() to return the contents of environmental variables that each hold a
  1798. directory pointer for a specific set of files.  Remember that GETENV() can
  1799. return not only system variables that DOS uses, such as PATH or COMSPEC,
  1800. but also environmental variables that you assign in DOS.  You can assign
  1801. these variables from anywhere in DOS, but many programs that use this
  1802. directory pointer system initialize the environmental variables in the
  1803. AUTOEXEC.BAT.
  1804.  
  1805. This type of a system in dBASE III PLUS would consist of creating three
  1806. basic classes of files (.PRG, .DBF, and .NDX) with three potential
  1807. locations.  You could, of course, have many more, but these serve the
  1808. purposes of example.
  1809.  
  1810. To set this up, you need first to create the environmental variables in DOS
  1811. with a series SET command lines as follows:
  1812.  
  1813.   SET DB_DIR=<database file directory path>
  1814.   SET PRG_DIR=<program file directory path>
  1815.        SET NDX_DIR=<index file directory path>
  1816.  
  1817. In the initialization area of your main application program you need to
  1818. define a series of memory variables using GETENV() that correspond to the
  1819. DOS environmental variables you have set up.  For example,
  1820.  
  1821.        db_dir  = GETENV("DB_DIR")
  1822.        prg_dir = GETENV("PRG_DIR")
  1823.        ndx_dir = GETENV("NDX_DIR")
  1824.  
  1825. Now that you have the directory pointers variables for each class of file,
  1826. you can use them to either SET the dBASE III PLUS PATH to the list of valid
  1827. directories or you can them explicitly in file access commands.  For
  1828. example,
  1829.  
  1830.        SET PATH TO &db_dir., &ndx_dir., &prg_dir.
  1831.  
  1832. or
  1833.  
  1834.   USE &db_dir.\<database file> INDEX &ndx_dir.\<index file>
  1835.  
  1836. and
  1837.  
  1838.   DO &prg_dir.\<program name>
  1839.  
  1840. One of the problems you may encounter using this technique is not having
  1841. enough environment space for your variable definitions.  This can happen
  1842. if, for example, you have a long PATH statement.  You can, however, change
  1843. the size of the DOS environment if you are running under PC/MS-DOS 3.1 and
  1844. above with the undocumented CONFIG.SYS command SHELL.  The general syntax
  1845. of the SHELL command is as follows:
  1846.  
  1847. SHELL=C:<path>\<command processor> C:<path>\ /P/E:<number of paragraphs>
  1848.  
  1849. When you wish to use SHELL, place it in your CONFIG.SYS file along with the
  1850. traditional FILES and BUFFERS settings.  To set up the SHELL command line,
  1851. specify the path to your command processor, the name of your command
  1852. processor (usually COMMAND.COM), the path again, a space, the /P and /E:
  1853. switches (no spaces between them) and the number of 16-byte paragraphs to
  1854. allocate to the environment space.  If you do not specify the number of
  1855. paragraphs, the default is 8 or a total of 128 bytes.  If you do specify a
  1856. /E: setting, the acceptable range is 11 to 63.
  1857.  
  1858. Be aware that the order and spacing of the SHELL command arguments are
  1859. vital.
  1860.  
  1861. Reference:
  1862.  
  1863. DeVoney, Chris. Using PC DOS. Indianapolis, Indiana: Que Corporation, 1986.
  1864. pps. 487-488.
  1865.  
  1866.  
  1867. >>> HELP
  1868.  
  1869. It is not documented that the HELP command requires a file handle. When
  1870. HELP is executed, dBASE III PLUS opens the file HELP.DBS. If the maximum
  1871. number of files (15) are already open, the error message "Too many files
  1872. are open." [6] is produced when HELP is executed.
  1873.  
  1874.  
  1875. >>> HELP.DBS
  1876.  
  1877. There are two HELP.DBS files shipped with dBASE III PLUS version 1.1; one
  1878. each on System disk #1 and System disk #2.  The file on System disk #2 is
  1879. for dBASE III PLUS single-user systems.  The file on System disk #1 is for
  1880. dBASE III PLUS Administrator.  
  1881.  
  1882.  
  1883. >>> ID.EXE
  1884.  
  1885. When terminate-and-stay-resident (TSR) programs are loaded and ID.EXE is
  1886. run, a Ctrl-C may be required at the "Check over your responses. Would you
  1887. like to re-edit them? (Y/N)." prompt.  In one instance, the order in which
  1888. the TSR programs were loaded affected the outcome of ID.EXE TSR programs
  1889. should be removed from memory before running ID.EXE
  1890.  
  1891.  
  1892. >>> IIF()
  1893.  
  1894. dBASE III PLUS parses the entire IIF() statement before executing the
  1895. function.  If either parameter of the IIF() function is erroneous, then the
  1896. entire function returns an error.  For example,
  1897.  
  1898.   mem = "dBASE"
  1899.   ? IIF(.T., mem, SUBSTR(mem, 10, 3))
  1900.  
  1901. returns the error message "***Execution error on SUBSTR() : Start point out
  1902. of range" even though the false condition is never executed.  The IIF()
  1903. function requires that each argument be a valid expression.
  1904.  
  1905. This is true for versions 1.0 and 1.1 of dBASE III PLUS.
  1906.  
  1907.  
  1908. >>> IMPORT
  1909.  
  1910. IMPORTing a PFS file from a drive other than the default creates the  new
  1911. .DBF, .FMT, and  .VUE files on the drive containing the PFS file, not the
  1912. default drive.  This occurs in  versions 1.0 and 1.1 of dBASE III PLUS.
  1913.  
  1914.  
  1915. >>> INDEXing Street Addresses
  1916.  
  1917. If you have a name and address database file, you might need to INDEX your
  1918. database file in street order.  The basic requirement is to create an index
  1919. file that keeps all like streets together, and orders the addresses by
  1920. numeric value within each street.  The reason for this is that INDEXing ON
  1921. the street alone will not give you a very meaningful order.  An additional
  1922. requirement is to assign all blank and "P.O. Box" addresses a value that
  1923. groups them at the top or bottom of the index so that you can easily skip
  1924. over them.
  1925.  
  1926. The following commands use IIF() in combination with other string functions
  1927. to create an index key that will produce an index file in street order. 
  1928. When you use these commands, enter the assignments to the memory variables
  1929. "ae" and "af" first, and then enter the INDEX command on one continuous
  1930. command line. As you type the INDEX command line, be sure to ignore
  1931. embedded blanks and semicolons within the INDEX expression to keep the
  1932. expression length less than the 220-character limit that dBASE III PLUS
  1933. imposes.
  1934.  
  1935.   * ---INDEXing street names.
  1936.   ae = [SUBSTR(Street, 1, AT(" ",Street) - 1)]
  1937.   af = [SUBSTR(Street, AT(" ",Street) + 1, 5)]
  1938.   INDEX ON IIF(     "BOX"  $ &ae.;
  1939.                .OR. "P.O." $ &ae.;
  1940.                .OR. LEN(TRIM(Street)) = 0,;
  1941.                " ",;
  1942.                &af. + RIGHT(STR(100000 + VAL(&ae),6),5);
  1943.            );
  1944.         TO Address
  1945.  
  1946.  
  1947. >>> INDEX File Size
  1948.  
  1949. To calculate the size of a dBASE III PLUS index file created with INDEX or
  1950. REINDEX, use the following program, Ndxsize.PRG.  The variable, keyexplen,
  1951. refers to the length of the index file's key expression and must be
  1952. provided. Keyexplen is 8 when using numeric or date type keys and is
  1953. rounded up to the nearest multiple of four on character type keys.  To
  1954. execute Ndxsize, use the following general syntax:
  1955.  
  1956.   USE <your database file>
  1957.   klen    = <length of index key>
  1958.   ret_val = 0
  1959.   DO Ndxsize WITH klen, ret_val
  1960.  
  1961.   * Program ...: Ndxsize.PRG
  1962.   * Author ....: Paul Redmond
  1963.   * Date ......: January 1, 1987
  1964.   * Note(s) ...: Calculates the optimal size of an index file after
  1965.   *              an INDEX or REINDEX.
  1966.   *
  1967.   PARAMETERS keyexplen, answer
  1968.   PRIVATE ALL
  1969.   blkkeycnt = INT(504 / (keyexplen + 8))
  1970.   blkleft   = RECCOUNT() / blkkeycnt
  1971.   blkcnt    = blkleft + 2
  1972.   blkkeycnt = blkkeycnt + 1
  1973.   DO WHILE blkleft > blkkeycnt
  1974.      blkleft = INT((blkleft - 1) / blkkeycnt) + 1
  1975.      blkcnt  = blkcnt + blkleft
  1976.   ENDDO
  1977.   answer = blkcnt * 512
  1978.   * EOP Ndxsize.PRG
  1979.  
  1980. Note that the size of the index file changes if an APPEND is used with an
  1981. indexed database file.  INDEX and REINDEX optimize the index file; this
  1982. formula approximates the optimum index file size.  This algorithm is
  1983. relevant to both versions 1.0 and 1.1 of dBASE III PLUS.
  1984.  
  1985.  
  1986. >>> INKEY()
  1987.  
  1988. The list of alternate keys on pages U6-29 [Original] and U6-41 [Revised
  1989. 6/86] is incomplete. Alternate keys not documented are:
  1990.  
  1991.  
  1992.   Special Key       Alternate Key
  1993.   -------------------------------
  1994.   Rightarrow      | Alt-<4>
  1995.   Leftarrow       | Alt-R
  1996.   Uparrow         | Alt-<5>
  1997.   Dnarrow         | Alt-O
  1998.   Ctrl-Rightarrow | Alt-<2>
  1999.   Ins             | Alt-U
  2000.   Del             | Alt-<7>
  2001.   Home            | Alt-<1>
  2002.   End             | Alt-<6>
  2003.   PgDn            | Ctrl-@, Alt-<3>
  2004.   Ctrl-End        | Alt-I
  2005.   Esc             | Ctrl-[
  2006.   Ctrl-PgUp       | Alt-S
  2007.   Ctrl-PgDn       | Alt-A
  2008.   F1              | Ctrl-\
  2009.  
  2010. Numbers enclosed in <> denote keys on the numeric keypad only.  All keys
  2011. can be duplicated by entering their ASCII key codes on the numeric keypad
  2012. while holding down the Alt key.
  2013.  
  2014. Though this list is included in the documentation under INKEY(), the
  2015. alternate keys are applicable throughout dBASE III PLUS.  For example, in
  2016. BROWSE Ctrl-\ toggles the cursor control keys menu instead of invoking
  2017. HELP, as F1 does.
  2018.  
  2019. Ctrl-Q is incorrectly documented as the alternate key for Esc; Ctrl-[ is
  2020. the alternate key for Esc.  In data-entry screens Ctrl-Q and Esc act the
  2021. same in that they both abort the entry screen without writing the changes. 
  2022. However, during LIST or DISPLAY Ctrl-Q resumes scrolling after Ctrl-S has
  2023. paused the output. Esc aborts the operation entirely.  INKEY() returns 27
  2024. for Esc and Ctrl-[, while Ctrl-Q returns 17.
  2025.  
  2026.  
  2027. >>> INKEY()
  2028.  
  2029. 1. The INKEY() function in the Developer's Release and dBASE III PLUS seems
  2030. to return the wrong answer after a WAIT command has been executed.  For
  2031. example,
  2032.  
  2033.    WAIT
  2034.    i = INKEY()
  2035.    ? i
  2036.  
  2037. The memory variable "i" will always contain the value zero no matter what
  2038. key was last pressed.  The reason for this is that WAIT pauses and waits
  2039. for a key value from the keyboard or type-ahead buffer.  Once the key is
  2040. sensed, it is taken from the buffer.  The INKEY() function also looks at
  2041. this buffer for a key, but finds that the last key has been taken by the
  2042. WAIT command and so returns a zero value.
  2043.  
  2044. The correct method to poll the keyboard for a key press is to use either
  2045. the WAIT command or the INKEY() function but not both in combination.  For
  2046. example,             
  2047.  
  2048.   * ---Use the WAIT command.              
  2049.   WAIT TO choice
  2050.   DO CASE                 
  2051.      CASE choice = 19                        
  2052.         ...
  2053.      CASE choice = 27                        
  2054.         ...             
  2055.   ENDCASE
  2056.   
  2057.   ---Use the INKEY() function.                  
  2058.   key = INKEY()
  2059.   DO WHILE key = 0                        
  2060.      key = INKEY()           
  2061.   ENDDO
  2062.   DO CASE                 
  2063.      CASE key = 19                   
  2064.         ...             
  2065.      CASE key = 27                    
  2066.         ...             
  2067.   ENDCASE
  2068.  
  2069. 2. The following program can be used to help you determine the key code for
  2070.    each key pressed.
  2071.  
  2072.   SET ESCAPE OFF                  
  2073.   SET TALK OFF            
  2074.   esc = 27
  2075.   DO WHILE .T.                    
  2076.      key = INKEY()
  2077.      DO WHILE key = 0                                
  2078.         key = INKEY()
  2079.      ENDDO                   
  2080.      ? key                   
  2081.      IF key = esc
  2082.         EXIT                    
  2083.      ENDIF           
  2084.   ENDDO           
  2085.   SET TALK ON
  2086.   SET ESCAPE ON           
  2087.   RETURN
  2088.  
  2089.  
  2090. >>> INKEY()
  2091.  
  2092. INKEY() returns the following codes for function keys:
  2093.  
  2094.   Key          Normal   Ctrl      Alt
  2095.   ===============================
  2096.    F1    28              94             104
  2097.    F2    -1              95             105
  2098.    F3    -2              96             106
  2099.    F4    -3              97             107
  2100.    F5    -4              98             108
  2101.    F6    -5              99             109
  2102.    F7    -6             100             110
  2103.    F8    -7             101             111
  2104.    F9    -8             102             112
  2105.    F10           -9             103             113
  2106.  
  2107.  
  2108.  
  2109. >>> INPUT
  2110.  
  2111. The INPUT command behaves differently in different versions of dBASE III.
  2112. In versions 1.0 and 1.1, it accepts a carriage return as a valid response
  2113. and does not create a variable. If one exists, it is left intact.  Control
  2114. is then returned to the calling program or the dot prompt.  In the
  2115. Developer's Release and dBASE III PLUS, however, INPUT does not accept a
  2116. carriage return as a valid response.  It scrolls the screen up one line and
  2117. awaits valid input each time a carriage return is entered and control is
  2118. not returned to the calling program or dot prompt until a valid input is
  2119. accepted.
  2120.  
  2121.  
  2122. >>> INSTALL.BAT
  2123.  
  2124. The files required to run dBASE III PLUS version 1.1 are not
  2125. documented.  They are:
  2126.  
  2127.      DBASE.EXE
  2128.      DBASE.OVL
  2129.      DBASEINL.OVL
  2130.      DBASE.MSG
  2131.      CONFIG.SYS    (In the root directory of the boot disk.)
  2132.  
  2133. Additional files needed by dBASE III PLUS (version 1.1) to
  2134. function fully but not required to load are:
  2135.  
  2136.      HELP.DBS
  2137.      ASSIST.HLP
  2138.      CONFIG.DB
  2139.  
  2140.  
  2141. >>> Interactive Mode
  2142.  
  2143. In dBASE III PLUS, you cannot continue command lines issued at the dot
  2144. prompt with a semicolon.  Previous versions supported this feature.
  2145.  
  2146. To continue a line beyond the width of the screen keep typing and the
  2147. command will scroll left.  In dBASE III PLUS, the command line is an
  2148. editable 254 character, single line, horizontal scroll space.  All keys
  2149. that are valid in full-screen modes are valid at command line.
  2150.  
  2151.  
  2152. >>> Justifying and Centering Strings
  2153.  
  2154. BY CHUCK LITZELL
  2155.  
  2156. Frequently, there is a  need to center or right justify a message on the
  2157. screen or in a report. The usual method is to add to the left of the string
  2158. the number of spaces required to offset the message to the desired
  2159. position. The dBASE III PLUS code to accomplish this is short, though
  2160. somewhat complicated owing to the mathematics involved.
  2161.  
  2162. Use this expression to center a string:
  2163.  
  2164.    string = IIF(width > LEN(string),;
  2165.         SPACE((width - LEN(string)) / 2),;
  2166.         "") + string
  2167.  
  2168. To right justify a string, use
  2169.  
  2170.    string = IIF(width > LEN(string),;
  2171.         SPACE(width - LEN(string)),;
  2172.         "") + string`
  2173.  
  2174. Often, reports and screen displays have headings that include a
  2175. left-justified string, a centered string, and a right-justified string.
  2176. Title.PRG (Figure 1) is a procedure that builds such a heading. The three
  2177. strings are passed as parameters, along with the width of the desired
  2178. heading. The resulting string is returned in the first parameter.
  2179.  
  2180.     * Program ...: Title.PRG
  2181.     * Versions ..: dBASE III PLUS v1.0, 1.1
  2182.     * Note(s) ...: Generates a report or screen title line with text
  2183.     *              left justified, centered and right justified.
  2184.     *              The result is returned in the first parameter, ltext.
  2185.     *
  2186.     *              The calling program must ensure that the width 
  2187.     *              specified is sufficient to contain the three 
  2188.     *              strings without overlap.  No error will result 
  2189.     *              if there is overlap, but the result string will be
  2190.     *              erroneous.
  2191.     *
  2192.     *              Example:
  2193.     *                 pagen  = 1
  2194.     *                 header = DTOC(DATE())
  2195.     *                 DO Title WITH header, "Employee Master Report",;
  2196.     *                               "Page " + LTRIM(STR(pagen)), 80
  2197.     *                 @ 1, 0 SAY header
  2198.     *
  2199.     PARAMETERS ltext, ctext, rtext, width
  2200.     *
  2201.     *          ltext  ::=  text to be left justified.
  2202.     *          ctext  ::=  text to be centered.
  2203.     *          rtext  ::=  text to be right justified.
  2204.     *          width  ::=  width of output string.
  2205.     *
  2206.       tmpstr = RIGHT(SPACE(width) + TRIM(rtext), width)
  2207.       tmpstr = STUFF(tmpstr, (width - LEN(TRIM(RTRIM(ctext)))) / 2,;
  2208.                LEN(TRIM(RTRIM(ctext))), TRIM(RTRIM(ctext)))
  2209.       ltext  = STUFF(tmpstr, 1, LEN(TRIM(RTRIM(ltext))), TRIM(RTRIM(ltext)))
  2210.       RETURN
  2211.     * EOP Title.PRG
  2212.  
  2213.  
  2214.  
  2215.  
  2216. >>> LIST
  2217.  
  2218. The LIST command is designed to display "Record in use by another" if a
  2219. record is locked by a different workstation with RLOCK().  This performs
  2220. according to expectation unless record number 1 is locked with RLOCK(), in
  2221. which case blank data is displayed for the record.
  2222.  
  2223. There is no work-around for this situation.
  2224.  
  2225.  
  2226. >>> LIST PROCEDURE
  2227.  
  2228. Often, when you are modifying an existing application where you have merged
  2229. a number of command files into a procedure file, you may want to get a list
  2230. of procedures.  You can do this easily using the DOS utility, FIND.EXE. 
  2231. FIND is a very fast, free text-search program that searches for a specified
  2232. string anywhere in a file, returning the lines where the search argument is
  2233. found. Optionally, FIND will return line numbers as well.  Unfortunately,
  2234. searches are case-sensitive and case is not a configurable option.  You
  2235. can, however, use this to your advantage by making the use of the command
  2236. verb PROCEDURE always uppercase and any other uses in comments and in the
  2237. SET and CLOSE PROCEDURE commands some combination of case and word length
  2238. to make the PROCEDURE declaration unique.
  2239.  
  2240. To list procedures from the DOS prompt use the following command line,
  2241.  
  2242.   FIND "PROCEDURE" <procedure file name>
  2243.  
  2244. You can, off course, RUN this command line from within dBASE III PLUS or
  2245. you can create a command file that calls FIND and constructs the FIND
  2246. command like the following,
  2247.  
  2248.   PROCEDURE Proc_file
  2249.   RUN FIND "PROCEDURE" &Proc_file..PRG
  2250.   RETURN
  2251.  
  2252. If you want to include line numbers in the listing add /N to the FIND
  2253. command line.
  2254.  
  2255.  
  2256. >>> LOAD
  2257.  
  2258. The explanation of "Table is full" (Using, pages 5-121 and 8-15) states
  2259. that you have attempted  to LOAD more than five files.  It actually occurs
  2260. if you try to LOAD more than 16 files.  Five  files was the limitation of
  2261. the Developer's Release.  This is corrected in the second edition of  the
  2262. documentation. 
  2263.  
  2264.  
  2265. >>> LOCATE/CONTINUE
  2266.  
  2267. To use CONTINUE, a search or scope condition must be specified in the
  2268. preceding LOCATE command, although a LOCATE without a FOR or WHILE
  2269. condition does not cause an error and positions the record pointer at the
  2270. top of the file.  However, following that LOCATE with CONTINUE returns the
  2271. error message "CONTINUE without LOCATE".
  2272.  
  2273. ASSIST does not prevent users from selecting Continue in this way.  In
  2274. ASSIST, executing Position:Locate with no condition positions the record
  2275. pointer at the top of the file and activates Position:Continue.  Choosing
  2276. Position:Continue returns the error message "CONTINUE without LOCATE."
  2277.  
  2278. This occurs in versions 1.0 and 1.1 of dBASE III PLUS.
  2279.  
  2280.  
  2281. >>> LOOP
  2282.  
  2283. The command verb LOOP does not appear in the second edition documentation
  2284. index. An explanation of LOOP can be found on page U5-114 under the DO
  2285. WHILE command.
  2286.  
  2287.  
  2288.  
  2289. >>> MENUBAR.BIN
  2290.  
  2291. The documentation for MENUBAR.BIN in the dBASE Programmer's Utilities
  2292. states that the  light bar can be moved within the menu with the eight
  2293. cursor-movement keys and that  Return and Esc are used to select items from
  2294. the menu.  However, it is not documented that  the cursor-movement keys can
  2295. be used to select items, as well as navigate through the menu.   When Ctrl
  2296. is used in conjunction with a cursor key, the item under the cursor is
  2297. selected  and the menu is exited without moving the cursor.  These keys and
  2298. their functions are  shown in Table 2. The key code returned by MENUBAR
  2299. corresponds to the INKEY() key  codes.
  2300.  
  2301.   Extension   Description       Commands
  2302.   
  2303.   BAK         Backup            MODIFY COMMAND
  2304.                                 MODIFY STRUCTURE
  2305.   CAT         Catalog           CREATE CATALOG
  2306.                                 SET CATALOG TO
  2307.   DBF         Database file     COPY STRUCTURE TO
  2308.                                 COPY TO
  2309.                                 COPY...STRUCTURE EXTENDED
  2310.                                 CREATE
  2311.                                 CREATE FROM
  2312.                                 IMPORT
  2313.                                 JOIN
  2314.                                 TOTAL
  2315.                                 SORT
  2316.   DBT         Memo field file   CREATE
  2317.                                 MODIFY STRUCTURE
  2318.                                 COPY TO
  2319.   DIF         VisiCalc file     COPY TO...TYPE DIF
  2320.   FMT         Format file       CREATE SCREEN
  2321.                                 IMPORT
  2322.   FRM         Report design 
  2323.               file              CREATE REPORT
  2324.   LBL         Label design file CREATE LABEL
  2325.   MEM         Memory variable 
  2326.               file              SAVE
  2327.   NDX         Index file        INDEX
  2328.   PRG         Program, 
  2329.               procedure         MODIFY COMMAND
  2330.   QRY         Query file        CREATE QUERY
  2331.   SCR         Screen design 
  2332.               file              CREATE SCREEN
  2333.   TBK         Memo file backup  MODIFY STRUCTURE
  2334.   TXT         Text file         COPY TO...TYPE DELIMITED
  2335.                                 COPY TO...TYPE SDF
  2336.                                 CREATE SCREEN (text image)
  2337.                                 SET ALTERNATE
  2338.                                 <Command> TO FILE
  2339.   WKS         Lotus 1-2-3 file  COPY TO...TYPE WKS
  2340.   VUE         View file         CREATE VIEW
  2341.                                 IMPORT
  2342.  
  2343.  
  2344. >>> MODIFY STRUCTURE
  2345.  
  2346. 1. MODIFY STRUCTURE generates the error "NET 803: Network path not found"
  2347. if the database file is in the root directory of any physical drive or
  2348. logical drive.  Even if network drive F: is attached to the subdirectory
  2349. \DBASE on the file server, it is still belongs to the logical root
  2350. directory of drive F:.  The work-around is to move the file to a
  2351. subdirectory or
  2352.  
  2353.                 COPY TO Temp
  2354.                 MODIFY STRUCTURE
  2355.  
  2356. After receiving the "NET 803" error message, the user must press A to
  2357. abort.  The database file structure will have been modified but zero
  2358. records will remain in file, then
  2359.  
  2360.                 APPEND FROM Temp
  2361.  
  2362. 2. MODIFY STRUCTURE generates the error "File is already open" if the
  2363. database structure contains a memo field and there are no records in the
  2364. file.
  2365.  
  2366. The work-around is to add one blank record to file.
  2367.  
  2368.  
  2369. >>> Precedence of File Attributes
  2370.  
  2371. Page 3-24 of the Networking section of the dBASE III PLUS Reference Manual
  2372. states that "File and field privileges can be used to override the file
  2373. access read/write attribute established at the operating system or network
  2374. shell level."  This is incorrect.  Attributes of directories and files
  2375. established at the network level always have precedence over the dBASE
  2376. Administrator Protect mechanism.
  2377.  
  2378.  
  2379. >>> Printing
  2380.  
  2381. dBASE III PLUS handles printing differently from earlier versions of dBASE
  2382. III.  Earlier versions of dBASE III relied on DOS to handle printer status
  2383. errors.  All error messages were generated and handled by DOS.  dBASE III
  2384. PLUS uses a different DOS call to send characters to the printer port. 
  2385. This new routine is faster but also returns a printer port time-out error
  2386. quicker. dBASE III PLUS checks the port status at initialization; errors
  2387. occurring after initialization are handled by DOS.  Because of these
  2388. differences, it is possible to get error messages in dBASE III PLUS when
  2389. none would not occur in dBASE III.  The differences are:
  2390.  
  2391. 1. When the print device is activated, dBASE III PLUS checks the printer
  2392. port for two specific conditions: "Invalid printer port" and "Printer is
  2393. either not connected or turned off."  If neither condition is true but an
  2394. error is still detected, dBASE III PLUS defaults to the "Printer not ready"
  2395. error message.  For example, on a parallel printer, pin 12 is used to
  2396. signal a "paper out" condition.  If pin 12 is missing or broken on a cable,
  2397. dBASE III PLUS checks the status of the printer port, finds an error
  2398. condition that does not meet one of the two specific conditions that are
  2399. tested, and returns the default error message, "Printer not ready."
  2400. "Invalid printer port" occurs when redirecting the printer to an invalid
  2401. port, such as LPT4.
  2402.  
  2403. "Printer is either not connected or turned off" may occur when redirecting
  2404. the printer to a valid COM port and attempting to print when that port does
  2405. not have a printer attached to it.
  2406.  
  2407. 2. Because different DOS versions have different time-out intervals for the
  2408. printer port, some DOS versions time out while waiting for the print buffer
  2409. to empty.  This will generate the DOS error message "Printer not ready.
  2410. Retry? (Y/N)."  This situation can be corrected by issuing the DOS command
  2411.  
  2412.    MODE LPT1:,,P
  2413.  
  2414. The "P" parameter at the end of the command line above instructs DOS to
  2415. infinitely retry the printer port.  This prevents the port from timing
  2416. out.  Error conditions (such as paper out or printer not connected) may
  2417. appear to hang the machine while DOS infinitely retries the port.  Unless
  2418. the error condition is resolved, a warm boot is required to terminate the
  2419. process.
  2420.  
  2421.  
  2422. >>> READKEY()
  2423.  
  2424. If you terminate a full-screen operation in dBASE III PLUS with a Ctrl-W or
  2425. Ctrl-End, READKEY() always returns 270, regardless of whether the contents
  2426. were altered or not.  In the Developer's Release, READKEY() returned a
  2427. value of 14 if the field or variable was not changed.  Additionally,
  2428. READKEY() always returns a value of 12 when you terminate a full-screen
  2429. operation with Esc or Ctrl-Q.
  2430.  
  2431.  
  2432. >>> RENAME
  2433.  
  2434. The RENAME command can move files between directories on the same disk
  2435. drive.  When the new filename includes a path different from the original
  2436. filename, RENAME moves the file to the directory specified by the new
  2437. path.  For example,
  2438.  
  2439.      RENAME \DBASE\Test.TXT TO \DOS\Test.TXT
  2440.  
  2441. Test.TXT is moved from \DBASE to \DOS, provided that the directory \DOS
  2442. exists on the same disk drive.  When renaming a file in a directory other
  2443. than the default, the path of the destination filename is required.  If the
  2444. destination path is ignored, dBASE III PLUS moves the file to the default
  2445. directory.  When the destination drive is different from the source drive,
  2446. dBASE III PLUS returns the error message "File already exists." [7].
  2447.  
  2448. This is inconsistent with DOS, which renames files without moving them. The
  2449. error message "Invalid parameter" is produced when a destination path is
  2450. included in the DOS RENAME command.
  2451.  
  2452.  
  2453. >>> REPLACE
  2454.  
  2455. REPLACEing a field of a database file from another work area when the
  2456. record pointer is at  EOF() increments the record counter and appends a
  2457. record to the file when the record  pointer is moved to the new record. 
  2458. For example,
  2459.  
  2460.   USE Test1
  2461.   GO BOTTOM
  2462.   SKIP               && Sets EOF() true.
  2463.   SELECT B
  2464.   USE Test2
  2465.   REPLACE Test1->Name WITH "XXXX"
  2466.   SELECT A
  2467.   GO RECNO()
  2468.  
  2469. adds a new record to Test1 and the contents of Name are "XXXX".  
  2470.  
  2471. Issuing multiple REPLACEs to a database file when EOF() is true increments
  2472. the record  counter for each REPLACE executed; however, data is added to
  2473. the current record only.  Do  not trust this method for appending records. 
  2474. This process occurs because the record counter is  increased; but, the
  2475. original data on the disk is not erased in the fields REPLACEd.  This 
  2476. means that the information on the disk in the region of the new record
  2477. becomes part of  that record.  When the data on the disk is from a
  2478. previously DELETEd and PACKed record,  the new record is marked for
  2479. deletion.  Other characters such as nulls and end-of-file  markers can
  2480. become embedded in the record.  This will corrupt the database file and
  2481. cause  unpredictable results.  
  2482.  
  2483. When  the field REPLACEd is an index key field, the results are slightly
  2484. different.   Performing a SEEK or FIND on the new expression returns the
  2485. error message "No find"  until REINDEX is issued.
  2486.  
  2487. Multiple REPLACEs to the EOF() add only the last expression REPLACEd after
  2488. REINDEX is  issued, all other data is lost.  DISPLAY STRUCTURE, GO BOTTOM,
  2489. and RECCOUNT() reveal  a record count consistent with the number of
  2490. REPLACEs executed.  COUNT displays the  number of records added previously
  2491. to the REPLACE command until REINDEX is issued.   Attempting to GO/GOTO the
  2492. new records produces the error message "Record is out of  range" [5].  SKIP
  2493. moves the record pointer through these records as if they were available.  
  2494. To reset the database file record count after multiple REPLACEs, issue
  2495. PACK.  This occurs in  both versions of dBASE III PLUS.
  2496.  
  2497.   Key           Function
  2498.   
  2499.   Return        Select the item under the light bar.
  2500.   Esc           Select the item under the light bar.
  2501.   Home          Move the light bar to the first column, first row.
  2502.   PgUp          Move the light bar to the first column, last row.
  2503.   End           Move the light bar to the last column, first row.
  2504.   PgDn          Move the light bar to the last column, last row.
  2505.   Ctrl-Home     Select the item under the light bar.
  2506.   Ctrl-PgUp     Select the item under the light bar.
  2507.   Ctrl-End      Select the item under the light bar.
  2508.   Ctrl-PgDn     Select the item under the light bar.
  2509.  
  2510.  
  2511. >>> REPLACE
  2512.  
  2513. In addition to the ability to change the contents of fields in work areas
  2514. other than the currently selected one by creating a global field pool with
  2515. SET FIELDS TO <field list> and then REPLACEing into the remote area, you
  2516. can also REPLACE into the remote area by specifying the alias before the
  2517. target field name.  For example,
  2518.  
  2519.    * ---REPLACE with SET FIELDS.
  2520.    SELECT 1
  2521.    USE Fileone
  2522.    SELECT 2
  2523.    USE Filetwo
  2524.    SET FIELDS TO Fileone->Fieldone, Fieldtwo
  2525.    REPLACE Fieldone WITH Fieldtwo
  2526.  
  2527.    * ---REPLACE without a fields list.
  2528.    SELECT 1
  2529.    USE Fileone
  2530.    SELECT 2
  2531.    USE Filetwo
  2532.    REPLACE Fileone->Fieldone WITH Fieldtwo
  2533.  
  2534.  
  2535. >>> REPLICATE()
  2536.  
  2537. Once the error message "Execution error on REPLICATE(): String too large."
  2538. [88] is produced, it does not reoccur until a valid numeric expression is
  2539. included in REPLICATE(). For example,
  2540.  
  2541.    * ---The next line produces the error.
  2542.    mvar = REPLICATE("A",32766)   
  2543.    * ---In the next line no error is produced.
  2544.    mvar = REPLICATE("A",32767)    
  2545.    mvar = REPLICATE("A",10)
  2546.    * ---The next line produces the error.
  2547.    mvar = REPLICATE("A",32767)   
  2548.  
  2549. The result of REPLICATE() is a null string whenever the second argument is
  2550. too large, regardless of whether an error message is returned. This is true
  2551. of versions 1.0 and 1.1 of dBASE III PLUS.
  2552.  
  2553.  
  2554.  
  2555. >>> REPORT FORM
  2556.  
  2557. CREATE REPORT Options:Double space report causes double spacing between
  2558. records only. All other portions of the REPORT FORM, including wrapped
  2559. fields, are single spaced. This is true of both versions of dBASE III PLUS.
  2560.  
  2561.  
  2562.  
  2563.  
  2564. >>> REPORT FORM
  2565.  
  2566. In both versions 1.0 and 1.1 of dBASE III PLUS, the width of a REPORT FORM
  2567. total is determined by the value of Contents:Column width.  There are
  2568. several conditions to consider:
  2569.  
  2570. 1. With a total width greater than the Contents:Column width, the decimal
  2571. portion of the total is truncated to accommodate the integer portion.  
  2572.  
  2573. 2. When the integer portion of the total exceeds the Contents:Column width,
  2574. the total displays in scientific notation.  
  2575.  
  2576. 3. If the value of the total is greater than 9E+98, an overflow displays.
  2577.  
  2578.  
  2579. >>> REPORT FORM (Memo Fields)
  2580.  
  2581. If you plan to print a memo field from another work area in a REPORT FORM,
  2582. including the alias as a part of the memo field name will not display the
  2583. memo field information when you execute the REPORT FORM.  You must instead
  2584. include a SET FIELDS TO command before you CREATE REPORT and not include
  2585. the memo field alias name in Columns:Field contents.  If you select the
  2586. memo field from the field list displayed by F10, delete the automatically
  2587. inserted alias before you exit the Column:Fields contents.
  2588.  
  2589. When you are ready to run your report, be sure to SET FIELDS TO the list of
  2590. fields you are using first or you will get the error message "Syntax error
  2591. in field expression" when you execute the REPORT FORM.  
  2592.  
  2593. In the following exmaple, Test1.DBF contains the memo field Notes. 
  2594.  
  2595.    * ---CREATE a REPORT to printing memo fields from a
  2596.    * ---nonactive work area. 
  2597.    SELECT 2
  2598.    USE Test1 INDEX Test1
  2599.    SELECT 1
  2600.    USE Test2
  2601.    SET FIELDS TO Name, Address, Test1->Notes
  2602.    CREATE REPORT Test1
  2603.  
  2604. In Columns:Field contents enter Notes and do not include the alias name.  
  2605.  
  2606. This situation occurs in both versions of dBASE III PLUS.
  2607.  
  2608.  
  2609. >>> REPORT FORM PLAIN
  2610.  
  2611. The following are some undocumented notes on REPORT FORM PLAIN.  These
  2612. situations arise in both versions 1.0 and 1.1 of dBASE III PLUS.
  2613.  
  2614. 1. Selecting PLAIN always reserves the first two lines of the first page of
  2615. the report for a heading, even when the headings are blank.
  2616.  
  2617. 2. Setting the Options:Lines per page equal to the printer form length
  2618. causes alternate blank pages to be printed when the report is run.  This
  2619. happens because a form feed, CHR(12), is printed at the end of each page. 
  2620. When Options:Lines per page equals the form length, the CHR(12) is printed
  2621. at the top of each new page causing a blank to be printed between printed
  2622. pages. 
  2623.  
  2624. 3. Setting Options:Lines per page equal to one less than the form length
  2625. prints a blank row between pages.  This occurs because the CHR(12) is
  2626. printed at the beginning of the last line on a page, skipping that line.  
  2627.  
  2628. >>> REPORT FORM TO PRINT
  2629.  
  2630. To imbed printer control characters in Options:Page title, Group: headings,
  2631. or Column:Heading, enter the control characters from the numeric keypad
  2632. with an Alt-<key sequence> and add 128 to the ASCII value.  The high order
  2633. value is necessary as dBASE III PLUS filters low value ASCII characters as
  2634. control keys.  
  2635.  
  2636. This procedure works only on printers that can strip off the eighth data
  2637. bit with the printer set to strip off the eighth bit.  Stripping off the
  2638. eighth bit causes characters whose ASCII values are greater than 127 to be
  2639. interpreted as 128 less than their actual value.
  2640.  
  2641. To enter an Alt-<key sequence>, hold down Alt and enter the ASCII decimal
  2642. value of the control code on the numeric keypad.  For example, to enter
  2643. CHR(15), enter Alt-143 (15 + 128 = 143).  This works in both versions of
  2644. dBASE III PLUS.
  2645.  
  2646.  
  2647. >>> RETURN
  2648.  
  2649. With the ON ESCAPE active, pressing Esc at a WAIT, INPUT, or ACCEPT command
  2650. causes the program to resume at the line following the WAIT, INPUT, or
  2651. ACCEPT command with no error messages.
  2652.  
  2653. In version 1.0, pressing Esc in response to an INPUT statement with SET
  2654. ESCAPE OFF hangs the system, while an Esc at a WAIT statement returns to
  2655. the dot prompt.
  2656.  
  2657.  
  2658.  
  2659. >>> RESTORE
  2660.  
  2661. The dBASE III Reference Manual for all versions incorrectly states about
  2662. the RESTORE command that any memory variables STOREd as PUBLIC remain
  2663. PUBLIC if the ADDITIVE option is used.  The ADDITIVE option to RESTORE will
  2664. allow the user to RESTORE variables as PUBLIC only if they are declared
  2665. PUBLIC before the RESTORE FROM <Filename> ADDITIVE command is issued.  If
  2666. the variables are not explicitly declared PUBLIC, they will be RESTOREd as
  2667. PRIVATE variables, regardless of their status when STOREd and SAVEd.  For
  2668. example,
  2669.  
  2670.    PUBLIC one, two
  2671.    STORE 1 TO one, two
  2672.    SAVE TO Mem
  2673.    CLEAR ALL
  2674.    RESTORE FROM Mem ADDITIVE  <-- Variables are RESTOREd
  2675.                                   without being redeclared PUBLIC.
  2676.  
  2677. will create PRIVATE variables "one" and "two," while,
  2678.  
  2679.    PUBLIC one, two
  2680.    STORE 1 TO one, two
  2681.    SAVE TO Mem
  2682.    CLEAR ALL
  2683.    PUBLIC one, two            <-- Variable is redeclared PUBLIC.
  2684.    RESTORE FROM Mem ADDITIVE
  2685.  
  2686. creates PUBLIC variables "one" and "two."
  2687.  
  2688.  
  2689. >>> RUN / !
  2690.  
  2691. RUN / ! produces the error message "Insufficient memory" [43] if the
  2692. maximum number of  files (15) are open.  To use RUN / !, a file handle must
  2693. be available.  However, when  ADDFILES.BIN from the dBASE Programmers
  2694. Utilities is loaded and used to open the  maximum 20 files, RUN / !
  2695. executes without error.  This is true for every version of dBASE  III PLUS.
  2696.  
  2697.  
  2698.  
  2699. >>> Scientific Notation
  2700.  
  2701. dBASE III PLUS has a limited ability to handle scientific notation.
  2702. Scientific notation is a number followed by the letter "e" followed by an
  2703. integer, where the integer is a power of ten that is multiplied by the
  2704. first number.  For example,
  2705.  
  2706.   1e4  = 1 * 10^4  = 10000
  2707.   -1e4 = -1 * 10^4 = -10000
  2708.  
  2709. dBASE III PLUS can use this notation for variable initialization, field
  2710. entry, APPENDing from text files, and in all numeric expressions.
  2711.  
  2712. Variable initialization: The command
  2713.  
  2714.     mem = 1e4
  2715.  
  2716. or
  2717.  
  2718.     mem1 = "1e4"       mem  = VAL(mem1)
  2719.  
  2720. stores 10000 to memory variable "mem."
  2721.  
  2722. Field entry: The command
  2723.  
  2724.        REPLACE <field name> WITH 1e4
  2725.  
  2726. stores 10000 to <field name>.
  2727.  
  2728. APPENDing FROM text files: If an SDF text file contains the number 1e4,
  2729. APPENDing it into a database file puts 1e4 into a numeric field--not 10000
  2730. as might be expected.  Numeric expressions involving this field generate
  2731. valid answers.  This method is the only one you can use because scientific
  2732. notation cannot be entered during full-screen editing.  To convert fields
  2733. in scientific notation to decimal, use this command syntax:
  2734.  
  2735.   REPLACE ALL <field name> WITH <field name>
  2736.  
  2737. dBASE III PLUS has a numeric accuracy of 15.9 digits, 13 digits when
  2738. comparing non-zero numbers.  Operations that exceed the accuracy may
  2739. produce the error message "Numeric overflow (data was lost)."
  2740.  
  2741. Numeric expressions:
  2742.  
  2743.  ? 1e4 * 3
  2744.  
  2745.   displays 30000.
  2746.  
  2747.  
  2748. >>> Converting Numbers to Scientific Notation
  2749.  
  2750. Although dBASE III PLUS allows you to convert numbers from scientific
  2751. notation to numbers in {decimal} notation (See...), it does not allow you
  2752. convert decimal notation to scientific notation.  The following programs,
  2753. Sci.PRG, converts numbers in decimal format to scientific notation.
  2754.  
  2755. To use Sci.PRG, call it with the following general syntax:
  2756.  
  2757.   ret_val = ""
  2758.   DO Sci WITH <number>, <decimals>, ret_val
  2759.  
  2760. where the arguments are defined as follows:
  2761.  
  2762.   number   ::= integer to be converted
  2763.   decimals ::= number of decimal places
  2764.   ret_val  ::= character variable to accept return value
  2765.  
  2766. Also included is a sample program, SciTest.PRG, that demonstrates how to
  2767. use Sci.PRG to list a set of numbers from a database file in scientific
  2768. notation.
  2769.  
  2770.  
  2771.  
  2772.   * Program ...: Sci.PRG
  2773.   * Author ....: Kenneth N. Getz
  2774.   * Date ......: March 1, 1987
  2775.   * Version ...: dBASE III PLUS
  2776.   * Note(s) ...: Converts x to scientific notation correct to decimal number
  2777.   *                                       of decimal places.  Works for any positive number within
  2778.   *                                       dBASE III PLUS limits.
  2779.   *
  2780.   PRIVATE ALL
  2781.   PARAMETERS x, dec, ret_val
  2782.   y = LOG(ABS(x)) / LOG(10)                               && Find order of magnitude.
  2783.   y = IIF(INT(y) = y, INT(y) + 1, INT(y))
  2784.   y = IIF(ABS(x) < 1,y - 1,y)
  2785.   z = x / 10^y                                                            && Normalize the number (0 < z < 10).
  2786.   order = 10^dec                                                          && Find order of rounding accuracy.
  2787.   fudge = IIF(x < 0, -.5, .5)
  2788.   q = INT( z * order + fudge)/order
  2789.   ret_val = LTRIM(STR(q,15,dec)) + "E" + IIF(ABS(x) < 1,"-","+") +
  2790.   LTRIM(STR(ABS(y)))
  2791.   RETURN
  2792.   * EOP Sci.PRG
  2793.  
  2794.  
  2795.  
  2796.   * Program ...: SciTest.PRG
  2797.   * Author ....: Kenneth N. Getz
  2798.   * Date ......: March 1, 1987
  2799.   * Version ...: dBASE III PLUS
  2800.   * Note(s) ...: A test program for Sci.PRG.  Uses the database SciTest.DBF
  2801.   *
  2802.   PRIVATE ALL
  2803.   PARAMETERS decimals
  2804.   STORE SPACE(30) TO ret_val
  2805.   USE Scitest
  2806.   DO WHILE .NOT. EOF()
  2807.           ? num
  2808.           DO Sci WITH num, decimals, ret_val
  2809.           ?? IIF(num < 0, SPACE(10), SPACE(11)) + ret_val
  2810.           SKIP
  2811.   ENDDO
  2812.   RETURN
  2813.   * EOP SciTest.PRG
  2814.  
  2815.  
  2816. >>> Semicolon
  2817.  
  2818. In dBASE III PLUS, you cannot continue commands issued at the dot prompt
  2819. with a semicolon.  The dBASE III PLUS command line is a 254-character
  2820. horizontal scroll space.  Previous versions of dBASE III allowed you to
  2821. continue a dot prompt command line with a semicolon.
  2822.  
  2823.  
  2824. >>> SET ALTERNATE TO
  2825.  
  2826. You can use the following program, Cpsep.PRG to COPY a database file to a
  2827. flat ASCII file with no separators between either fields or records.  Such
  2828. a file differs from the SDF format in that each record is not separated
  2829. with a carriage return/line feed pair.
  2830.  
  2831.   * Program ...: Cpsep.PRG
  2832.   * Author ....: Quinn Wildman
  2833.   * Date ......: January 1, 1987
  2834.   * Note(s) ...: Creates a text file image of a database file with
  2835.   *              no record separators.
  2836.   *
  2837.   SET TALK ON
  2838.   ACCEPT "Enter name of text file: " TO txtfile
  2839.   ACCEPT "Enter name of database file: " TO dbfile
  2840.   USE &dbfile
  2841.   SET ALTERNATE TO &txtfile
  2842.   SET ALTERNATE ON
  2843.   DO WHILE .NOT. EOF()
  2844.      cnt = 1
  2845.      DO WHILE LEN( FIELD( cnt )) <> 0
  2846.         macro = FIELD( cnt )
  2847.         ?? ¯o
  2848.         cnt = cnt + 1
  2849.      ENDDO
  2850.      SKIP
  2851.   ENDDO
  2852.   SET ALTERNATE OFF
  2853.   CLOSE ALTERNATE
  2854.   CLEAR ALL
  2855.   SET TALK ON
  2856.   * EOP Cpsep.PRG
  2857.  
  2858. >>> SET CATALOG ON
  2859.  
  2860. If you assign an ALIAS when you USE a database file, the catalog does not
  2861. store the ALIAS but instead stores the filename as the ALIAS.  For example,
  2862.  
  2863.     SET CATALOG TO <filename>
  2864.     USE Test1 ALIAS Testfile
  2865.     SELECT 10
  2866.     LIST
  2867.        ^------ This show the ALIAS as "Test1,"
  2868.                not "Testfile."
  2869.  
  2870.  
  2871. >>> SET CATALOG ON
  2872.  
  2873. With an active Catalog and SET CATALOG ON, creating a new index or issuing
  2874. SET INDEX TO an existing index file does not prompt for a file title
  2875. description as documented in the Using dBASE III PLUS manual.  Instead,
  2876. dBASE III PLUS places the index key expression in the Catalog field Title.
  2877.  
  2878.  
  2879. >>> SET CATALOG TO ?
  2880.  
  2881. Attempting to open a catalog file that has the same name as an open
  2882. database file or assigned alias name produces the error message "ALIAS name
  2883. already in use." [24].  To avoid the error message, assign a different
  2884. alias to the database file or close the database file before executing SET
  2885. CATALOG TO.  For example,
  2886.  
  2887.  
  2888.      USE Test
  2889.      SET CATALOG TO Test
  2890.  
  2891.  
  2892. produces the error message.  This occurs in both versions 1.0 and 1.1 of
  2893. dBASE III PLUS. 
  2894.  
  2895.  
  2896. >>> SET COLOR
  2897.  
  2898. The SET COLOR TO command changed somewhat in the Developer's Release and
  2899. dBASE III PLUS.  Formerly, colors could be referenced by number or letter
  2900. code.  With the Developer's Release and dBASE III PLUS, only letter codes
  2901. are accepted. Additionally, there are several new options.  Black can now
  2902. be referenced with the letter code N, inverse video with the letter code I,
  2903. and the screen can be blanked with the code X.  The following table shows
  2904. all the default color attributes for dBASE III from version 1.0 through
  2905. dBASE III PLUS.
  2906.  
  2907. Color Attribute Table
  2908.  
  2909.                                            Developer's Release
  2910.                     dBASE III              dBASE III PLUS
  2911.   Color             Letter   Number        Letter Only
  2912.   
  2913.   Black             <space>    0      |    N or <space> 
  2914.   Blue              B          1      |    B 
  2915.   Green             G          2      |    G 
  2916.   Cyan              BG         3      |    BG 
  2917.   Red               R          4      |    R 
  2918.   Magenta           BR         5      |    BR 
  2919.   Brown             GR         6      |    GR 
  2920.   White             W or RB    7      |    W or RB
  2921.   
  2922.   Other
  2923.   
  2924.   Blank                               |    X 
  2925.   Blinking          *                 |    * 
  2926.   High intensity    +                 |    + 
  2927.   Inverse video                       |    I 
  2928.   Underline         U                 |    U
  2929.  
  2930. Three other capabilities are added to color in dBASE III PLUS. First, there
  2931. is a new function, ISCOLOR(), that returns a true value (.T.), if your
  2932. monitor is in color mode.  Second, SET COLOR supports a toggle syntax,
  2933. ON/OFF, to toggle your monitor between color and monochrome modes, if your
  2934. machine supports both. Lastly, a background option is added for machines
  2935. that cannot set the background of individual characters with the standard
  2936. and enhanced options.
  2937.  
  2938.  
  2939. >>> SET COLOR TO
  2940.  
  2941. It is not documented that the U and I arguments of SET COLOR TO, which are
  2942. for monochrome monitors, set the color to black when used on a color
  2943. monitor. For example, on a color monitor
  2944.  
  2945.    SET COLOR TO U/I
  2946.  
  2947. is equivalent to 
  2948.  
  2949.    SET COLOR TO N/N
  2950.  
  2951.  
  2952.  
  2953. >>> SET COLOR TO
  2954.  
  2955. Using an attribute (high intensity or blinking) of colors with SET COLOR TO
  2956. applies to the foreground setting only and has no effect on background
  2957. colors.  In fact, if you assign an attribute to a background color, dBASE
  2958. III PLUS passes the attribute to the foreground color instead.  Because of
  2959. this, the colors gray (N+) and yellow (GR+) appear as black and brown
  2960. respectively when used for background settings.  
  2961.  
  2962. Keep in mind that for color settings there are three basic settings
  2963. (display, enhanced, and border) and that within each one there are both
  2964. foreground and background colors.
  2965.  
  2966.    SET COLOR TO [[<standard>][,<enhanced>][,<border>]]
  2967.  
  2968. where 
  2969.  
  2970.    standard  ::= [<foreground>][/<background>]
  2971.    enhanced  ::= [<foreground>][/<background>]
  2972.    border    ::= [<foreground>][/<background>]
  2973.     and
  2974.  
  2975.    foreground ::= [<letter>[{attribute}]]
  2976.    background ::= <letter>
  2977.     It appears that the attribute although it affects the color is a
  2978. function of the setting.  Each setting, therefore, can have only one
  2979. attribute which is applied to the foreground color.  This behavior is in
  2980. contrast to dBASE III version 1.0 and 1.1, where attempting to assign an
  2981. attribute to a background color did not pass the attribute to the
  2982. foreground color. 
  2983.  
  2984.  
  2985. >>> SET DATE FRENCH
  2986.  
  2987. The format of date variable display varies between versions 1.1 and the
  2988. Developer's Release and dBASE III PLUS, when SET DATE is FRENCH.  For
  2989. example,
  2990.  
  2991.                        dBASE III         Developer's Release
  2992.                        Version 1.1       dBASE III PLUS
  2993.  
  2994.      SET DATE FRENCH    DD.MM.YY          DD/MM/YY
  2995.  
  2996. The Developer's Release and the dBASE III PLUS displays are identical to
  2997. SET DATE BRITISH.
  2998.  
  2999.  
  3000. >>> SET DELETED ON
  3001.  
  3002. SET DELETED ON can affect the FIND command when there is more than one
  3003. record in the database file with the same index key.  For example, suppose
  3004. there are two "Johnsons" in the database file.  The first is marked for
  3005. deletion and the second is locked with RLOCK() at a different workstation. 
  3006. If SET DELETED is ON, and you try to FIND "Johnson", you will get the
  3007. message "No find" instead of the expected "Record is in use by another." 
  3008. Under any other circumstance, a FIND on a record locked with RLOCK()
  3009. returns the message "Record is in use by another" and positions the record
  3010. pointer to that record.
  3011.  
  3012. There is no work-around at this time.
  3013.  
  3014.  
  3015. >>> SET ESCAPE OFF
  3016.  
  3017. Esc terminates an active READ regardless of the status of SET ESCAPE in
  3018. both versions of dBASE III PLUS.
  3019.  
  3020. Documentation Index
  3021.  
  3022. The index for the second edition of the documentation contains incorrect
  3023. page references. The specific references are shown in Figure 2.
  3024.  
  3025.    Item                               Incorrect           Correct
  3026.    --------------------------------------------------------------
  3027.    Function keys (Page X-17)          U5-224 - U5-225     U5-234
  3028.    Memo field (Page X-20)
  3029.         adjusting width for output    U5-234              U5-243
  3030.         editing in programs           P5-16               P5-26
  3031.  
  3032.  
  3033. >>> SET FIELDS TO
  3034.  
  3035. Issuing the SET FIELDS TO <Field list> command automatically SETs FIELDS
  3036. ON, regardless of the FIELDS status prior to issuing the SET FIELDS TO
  3037. command.
  3038.  
  3039. The dBASE III PLUS Reference Manual states on page 5-169 of the Using
  3040. section, under the SET FIELDS TO command, "The list of fields is not active
  3041. unless the SET FIELDS command is ON."  This statement implies that the
  3042. command SET FIELDS ON must be executed explicitly to activate the current
  3043. field list after creating it.  Anytime the command SET FIELDS is executed
  3044. either to create a fields list or to add to one, FIELDS are SET ON.
  3045.  
  3046.  
  3047. >>> SET FILTER TO
  3048.  
  3049. It is not documented in any of the dBASE III PLUS reference manuals that
  3050. certain commands ignore the SET FILTER TO condition.  Specifically, the
  3051. commands DISPLAY (current record), DISPLAY RECORD <n>, GO/GOTO, or any
  3052. command with the scope RECORD <n> or NEXT <n>.  For example, if the SET
  3053. FILTER TO condition excludes record five and GOTO 5 is executed, a
  3054. subsequent DISPLAY reveals the contents of the record.
  3055.  
  3056.  
  3057. >>> SET HISTORY OFF
  3058.  
  3059. Page U5-180 of the original documentation incorrectly states, "The command
  3060. SET HISTORY OFF disables the history feature so that prior commands can't
  3061. be recalled."  Page U5-237 of the revised documentation incorrectly states,
  3062. "The command SET HISTORY OFF clears the history buffer."
  3063.  
  3064. The command SET HISTORY OFF suppresses the storage of commands into the
  3065. history buffer.  Commands entered in HISTORY prior to SET HISTORY OFF may
  3066. still be displayed, edited, and re-executed.  To clear the history buffer
  3067. of commands, SET HISTORY TO 0.
  3068.  
  3069.  
  3070. >>> SET ORDER TO
  3071.  
  3072. You must reposition the record pointer after executing SET ORDER TO in
  3073. dBASE III PLUS.  The easiest way to do this is to issue the command:
  3074.  
  3075.    GO RECNO()
  3076.  
  3077. This will cause the record pointer to reposition itself to the current
  3078. record position updating the internal record pointer.  If, however, EOF()
  3079. returns true (.T.), this won't work.  In this case, use the following
  3080. command:
  3081.  
  3082.    GO IIF(EOF(), RECCOUNT(), RECNO())
  3083.  
  3084.  
  3085. >>> SET PATH TO
  3086.  
  3087. The original documentation does not include the path length limitations for
  3088. the SET PATH TO command.  The path is limited to 60 characters.  Exceeding
  3089. that limit will produce the error message "Maximum path length exceeded"
  3090. [146].
  3091.  
  3092.  
  3093. >>> SET PROCEDURE TO
  3094.  
  3095. Beginning in Developer's Release, you can have a command file that SETs
  3096. PROCEDURE to itself, effectively allowing you to create single file
  3097. applications such as those you could create with dBCODEing and dBLINKing.
  3098.  
  3099. Additionally, you can CLOSE the PROCEDURE within the calling program.  Be
  3100. sure, however, you do not CLOSE PROCEDURE within any of the procedures or
  3101. dBASE III PLUS will return the error message "File is already open."
  3102.  
  3103. For example,
  3104.  
  3105.   * ---Sayhello.PRG
  3106.   SET PROCEDURE TO Sayhello                    && SETs PROCEDURE TO itself.
  3107.   DO Proc1
  3108.   DO Proc2
  3109.   CLOSE PROCEDURE
  3110.   RETURN
  3111.  
  3112.   PROCEDURE Proc1
  3113.   ? "Hi there, I'm procedure number One and I love black beans."
  3114.   RETURN
  3115.  
  3116.   PROCEDURE Proc2
  3117.   ? "Howdy, I'm procedure number Two and I'm a Taurus."
  3118.   RETURN
  3119.   * EOP Sayhello.PRG
  3120.  
  3121. In dBASE III version 1.1, doing this returned the error message "File is
  3122. already open."
  3123.  
  3124.  
  3125. >>> SET RELATION TO
  3126.  
  3127. The description of "Cyclic relation" under Error Messages contains the line
  3128. "SET  RELATION, without any parameters, disconnects all relations from the
  3129. currently selected  work area."  But SET RELATION with no arguments
  3130. produces a "Syntax error."  The proper  command is SET RELATION TO with no
  3131. argument.  This is corrected in the second edition  of the documentation.
  3132.  
  3133.  
  3134. >>> SET RELATION TO
  3135.  
  3136. Throughout the documentation for dBASE III PLUS, there is some ambiguity
  3137. about the various ways you can link database files with SET RELATION TO.
  3138.  
  3139. SET RELATION TO relates two database files in three different ways.
  3140.  
  3141. 1. You can relate two database files with a key expression allowing you to
  3142. create connections between database files based on value.  It is important
  3143. to stress that you are not confined to a single common field.  The linking
  3144. expression can be any legitimate dBASE III PLUS expression.  To work, the
  3145. key expression must return a value from the source work area that matches a
  3146. value in the master index file of the target work area.  Because the
  3147. relation is created by an expression, you can take two dissimilar database
  3148. file structures that contain common values and create a relation between
  3149. them.  In exactly the same way, you can create a relation between database
  3150. files that have common fields.  In both cases, the mechanism is the same:
  3151. the relation is created by an expression.
  3152.  
  3153. 2. Another way to relate database files is by record number.  This type of
  3154. relation allows you to link two database files having no common field
  3155. values but have a one-to-one relation based on physical position.  Record
  3156. one in the source corresponds to record one in the target file and so on.
  3157. Generally, you will use this formulation to create a virtual database file
  3158. where you need a number of fields greater than the dBASE III PLUS limit of
  3159. 128 per database file.
  3160.  
  3161. When the record pointer moves in the source database file, the record
  3162. pointer in the target moves to the same record number as the source
  3163. record.  For example,
  3164.  
  3165.         * ---Setup and syntax with a physical relation.
  3166.         SELECT B
  3167.         USE File2
  3168.         SELECT A
  3169.         USE File1 INDEX File1
  3170.         SET RELATION TO RECNO() INTO File2
  3171.         * ---List records from File1 and File2.
  3172.         DO WHILE .NOT. EOF()
  3173.                 ? Field1, Field2, File2->Field1, File2->Field2
  3174.                 * ---Advance File1 and File2 pointer.
  3175.                 SKIP
  3176.         ENDDO
  3177.  
  3178.         * ---Setup and syntax with no relation.
  3179.         SELECT B
  3180.         USE File2
  3181.         SELECT A
  3182.         USE File1 INDEX File1
  3183.         * ---List records from File1 and File2.
  3184.         DO WHILE .NOT. EOF()
  3185.                 ? Field1, Field2, File2->Field1, File2->Field2
  3186.                 * ---Advance the File1 pointer.
  3187.                 SKIP
  3188.                 * ---Advance the File2 pointer.
  3189.                 recpos = RECNO()
  3190.                 SELECT B
  3191.                 GO recpos
  3192.                 SELECT A
  3193.         ENDDO
  3194.  
  3195. In order to build various index sort orders, put all of your key fields in
  3196. the master database file as the diagram below indicates.  This is important
  3197. since a relation based on RECNO() precludes the use of an index file in the
  3198. target work area.
  3199.  
  3200.                 Master -----> Sub1 ------> Sub2                 (Keys)
  3201.  (Non-keys)   (Non-keys)
  3202.  
  3203. 3. The last type of relation is a physical link between database files
  3204. based on a numeric expression.     If the linking expression evaluates to
  3205. numeric and the target database file is not INDEXed, then the target record
  3206. pointer moves to the record number returned by the linking expression each
  3207. time the source database file pointer moves.
  3208.  
  3209. For example, the following linking expression relates two unINDEXed
  3210. database files so each pair of adjacent records in the source database file
  3211. points to a single record in the target file.
  3212.  
  3213.    IIF(MOD(RECNO(),2)=1,INT(RECNO()/2)+1,INT(RECNO()/2))
  3214.  
  3215. Record numbers one and two in the source point to record number one in the
  3216. target, three and four in the source point to two in the target, and so on.
  3217.  
  3218. This type of relation can be used to build virtual data structures based on
  3219. a link that is a combination of value and physical location.
  3220.  
  3221. In general, it is important to your mastery of dBASE to understand the
  3222. truly dynamic nature of relating database files with SET RELATION TO.
  3223.  
  3224. For more information on SET RELATION TO, refer to the page D3-11 of the
  3225. April 1985 issue of TechNotes.
  3226.  
  3227.  
  3228. >>> SET RELATION TO
  3229.  
  3230. In versions 1.0 and 1.1 of dBASE III, a relation could be released with the
  3231. command SET RELATION.  In the Developer's Release and dBASE III PLUS, this
  3232. command returns a syntax error although it releases the RELATION.  The
  3233. proper and supported command syntax to release a relation is SET RELATION
  3234. TO.
  3235.  
  3236.  
  3237. >>> SET SCOREBOARD/SET STATUS
  3238.  
  3239. The SET SCOREBOARD ON/OFF and SET STATUS ON/OFF commands will clear the
  3240. entire screen when issued in dBASE III PLUS.  In previous versions, SET
  3241. SCOREBOARD ON/OFF would affect only the SCOREBOARD area of the screen.
  3242.  
  3243.  
  3244. >>> SET VIEW TO
  3245.  
  3246. If any change has been made to any of the component parts of a view,
  3247. invoking that view file with SET VIEW TO will return an error message.  The
  3248. specific message will depend on the error in the view file.
  3249.  
  3250. For example, if the name of field in the fields of the view has been
  3251. changed by MODIFYing the STRUCTURE of one of the constituent database
  3252. files, issuing the SET VIEW TO command will return "Variable not found."
  3253. Once this condition has occurred, there is no way to open the view file and
  3254. modify it, as MODIFY VIEW will return the same error message.  The file
  3255. must be deleted and re-created, or the environment must be made consistent
  3256. with the view file once more.
  3257.  
  3258.  
  3259. >>> STORE
  3260.  
  3261. Attempting to STORE a string containing "&&" to a memory variable produces
  3262. the error message "Unterminated string" when executed.  This is because the
  3263. double ampersands are interpreted as an in-line comment, effectively
  3264. removing the closing quotation mark from the command line.  To work around
  3265. this, split the character expression between the ampersands into two
  3266. expressions and concatenate them when assigning them to the memory
  3267. variable.  For example, the following is a successful instance of embedding
  3268. "&&" in a string.
  3269.  
  3270.    STORE "Before the &" + "& and after." TO mvar
  3271.  
  3272.  
  3273. >>> Tandy printers
  3274.  
  3275. Some older Tandy printers do not recognize CHR(12) as a form feed
  3276. character.  To correct  this problem, install the device driver LPDRVR.SYS
  3277. in CONFIG.SYS.  LPDRVR.SYS is  provided with Tandy DOS 3.x.  LPDRVR.SYS
  3278. keeps track of the number of carriage  return/line feeds sent to the
  3279. printer.  When a form feed is transmitted, LPDRVR.SYS  sends the remaining
  3280. number of carriage return/line feeds necessary to reach the top of the 
  3281. next page.  To install LPDRVR.SYS, add the following line to CONFIG.SYS:
  3282. DEVICE = LPDRVR.SYS
  3283.  
  3284. If LPDRVR.SYS is not available, it may be obtained from Tandy.  The phone
  3285. number for  hardware support is (817)338-2394 and the phone number for
  3286. software support: (817)338-2390  and (817)338-2392 or leave a message at
  3287. their main switchboard, (817)390-3011.
  3288.  
  3289.  
  3290. >>> TRANSFORM()
  3291.  
  3292. In both versions 1.0 and 1.1 of dBASE III PLUS, including a  TRANSFORM()
  3293. expression with a PICTURE function in the CREATE REPORT Columns:Contents
  3294. may require resetting Contents:Width to a value greater than the default. 
  3295. When the expression to be TRANSFORMed is numeric, using the default
  3296. Contents:Width of 10 forces the displays to wrap to a second line. 
  3297. Increasing the Contents:Width corrects the problem.  
  3298.  
  3299. The following is a list of functions and the corresponding minimum values:
  3300.  
  3301.    Function                            Width
  3302.    -----------------------------------------------
  3303.    TRANSFORM(<field name>, "@C")          16
  3304.    TRANSFORM(<field name>, "@X")          16
  3305.    TRANSFORM(<field name>, "@(")          15
  3306.    TRANSFORM(<field name>, "@Z")          13
  3307.    TRANSFORM(<field name>, "@B")    LEN(<field name>)
  3308.  
  3309.  
  3310. >>> Trapping the Esc Key
  3311.  
  3312. In dBASE III PLUS, version 1.1, SET ESCAPE OFF is ignored by the WAIT,
  3313. INPUT, and ACCEPT commands. If the user presses Esc in response to any of
  3314. these commands, dBASE III PLUS responds with the "Cancel, Ignore, or
  3315. Suspend?" message, and the user can cancel the application program.
  3316.  
  3317. The work-around is to add an ON ESCAPE command to the application:
  3318.  
  3319.    ON ESCAPE DO Esc_back
  3320.  
  3321. Esc_back.PRG needs just one line:
  3322.  
  3323.  
  3324.  
  3325. >>> UNINSTAL.BAT
  3326.  
  3327. UNINSTAL.BAT deletes CONFIG.SYS, if it exists, in the target drive default
  3328. directory.  This is potentially dangerous if the default directory of the
  3329. target disk is the root directory.  Some systems, such as older Bernoulli
  3330. drives, require CONFIG.SYS to boot.  Use caution when uninstalling dBASE
  3331. III PLUS from a root directory.
  3332.  
  3333. >>> UPDATE
  3334.  
  3335. If you are trying to UPDATE one database file from another and the relation
  3336. between them is many-to-one, you may have found that the UPDATE command
  3337. does not support this formulation.  The UPDATE command only updates the
  3338. first instance in the target database file.  This means that the UPDATE
  3339. command is useful only when the relation between the source and the target
  3340. database files is one-to-one.  To update your many-instance file from the
  3341. single-instance file, use the REPLACE command in combination with SET
  3342. RELATION.  For example,
  3343.  
  3344.    SELECT 2
  3345.    USE <source> INDEX <source index>
  3346.    SELECT 1
  3347.    USE <target> INDEX <target index>
  3348.    SET RELATION TO <key> INTO <source>
  3349.    REPLACE ALL <target field1> WITH <source>-><field1>,;
  3350.                         <target field2> WITH <source>-><field2>,;
  3351.                         <target field3> WITH <source>-><field3>
  3352.  
  3353.  
  3354. >>> USE
  3355.  
  3356. If byte 15 of a .DBF file header contains a value other than a null, USEing
  3357. the file in dBASE III PLUS produces the error message "Database is
  3358. encrypted."  This byte is used by the dBASE Administrator to mark a file as
  3359. encrypted.  Earlier versions of dBASE III ignored this byte.  If you
  3360. encounter this error message when USEing a database file in single-user
  3361. mode, run NEWHEAD.BAS or use DEBUG to change the byte back to a null.  Note
  3362. that in order to use DEBUG, your database file must be smaller in size than
  3363. the amount of free memory available prior to running DEBUG.
  3364.  
  3365.  
  3366.