dBASE III PLUS Anomalies and Workarounds >>> @...CLEAR TO @...CLEAR TO does not erase a single line from the screen, although the @...TO draws a single line on the screen. The minimum vertical area @...CLEAR TO can erase is two lines. For example, @ 2,0 TO 2,79 @ 2,5 CLEAR TO 2,25 draws a line from 2,0 to 2,79, but does not erase from 2,5 to 2,25. To work around, use @ , with no parameter to erase the entire line. To erase portions, use @ , SPACE(). >>> @...GET...READ Performing a GET on a PRIVATE memory variable that you created in a lower program does not allow input when you RETURN to the calling program and issue a READ. For example, DO WHILE .T. DO Test READ && Test.PRG sets up a PRIVATE variable. ENDDO * ---Test.PRG mem1 = SPACE(2) @ 12,41 GET mem1 && This GET will never be READ. RETURN Under certain circumstances, this causes the PICTURE template of some @...GET commands to be read into the GET as a literal value. This occurs if the command @...SAY DATE() is executed before READing the PRIVATE memory variable, and if the PICTURE template meets its own criteria as valid input. For example, a "9" is valid input to the PICTURE template "9." Once this error condition has occurred, every PICTURE template that meets its own criteria is READ as a literal value. READ ignores the GET and the value of the field or memory variable is not changed. The only way to stop this is to reload dBASE III PLUS. For example, DO WHILE .T. mem = SPACE(6) @ 10,41 SAY DATE() @ 11,41 GET mem PICTURE "999999" READ DO Test READ && Test.PRG sets up a PRIVATE variable. ENDDO In this example, the memory variable "mem" always READs as "999999" until you reload dBASE III PLUS. >>> @...SAY/GET Using @...SAY/GET to display information or scrolling text to line 0 with SET SCOREBOARD ON and SET STATUS OFF, will cause the information to remain on line 0 and not scroll off the top of the screen as new information is displayed. For example, the following block of code will cause this anomaly. SET SCOREBOARD ON SET STATUS OFF item = "123456789" @ 0,15 SAY "This is a test." @ 5,10 SAY "What is this?" GET item READ In order to erase this line, you must use @ 0,0, CLEAR, SET SCOREBOARD ON/OFF, or SET STATUS ON/OFF. To prevent conflict, avoid the use of line 0 with SET SCOREBOARD ON. Be aware, however, when using CREATE SCREEN that the first line on the blackboard is line 0. Additionally, IMPORT also writes to line 0 when creating its format file. >>> ASSIST 1. Performing any full-screen edit on a record found with the Locate option of the Position menu disables the Continue option. When you return from a full-screen operation, Continue is no longer highlighted and so cannot be accessed. If you need to LOCATE and CONTINUE, specify the LOCATE in ASSIST and CONTINUE at the dot prompt. If you are EDITing FOR a condition, you can also EDIT with a FOR clause from the dot prompt. If you wish to remain in the ASSIST, CREATE a QUERY, and EDIT from this subset of records. 2. Whenever you choose a drive from any menu of available drives, that drive becomes the default. >>> CREATE REPORT Pressing Return twice when highlighting the contents area of the Columns menu, creates an empty column in your REPORT FORM. Although you get no error message in CREATE REPORT, when you subsequently run the report, the error message "Syntax error in field expression" is returned. To work-around, MODIFY the REPORT and delete the empty column with Ctrl-U. You will find the location of the empty column in the Report Format area designated by a question mark. >>> CREATE SCREEN 1. If you are editing on the blackboard and you press Ctrl-T with the cursor on a line and column to the left of a special character (!,?,.,@), the computer freezes requiring a warm boot. 2. If you terminate a box at column 79 and a row greater than 21 and then press PgUp, the box breaks into two sections, overwrites the menu line, and you cannot access line zero to edit it. A subsequent save of the screen and re-entering CREATE/MODIFY SCREEN does not correct the problem. Note that this problem occurs only when SET STATUS is ON. If you must terminate a box at this location, SET STATUS OFF before entering CREATE/MODIFY SCREEN. >>> CREATE/MODIFY SCREEN When you use the option of the Contents submenu of the Modify menu to add a new field to the current database file, it is automatically created as a character field with a length of one and all the records of the previous structure are APPENDed into the new one at that point. To create a new field that is not character type or has a length of greater than one, you must modify the attributes of the new field after it has been created. Be aware that if you are MODIFYing the STRUCTURE of a database file with a large number of records, each time you add or change an attribute of a field, the entire database file will be APPENDed into the new structure. Multiple changes necessitates multiple APPENDs. If you are anticipating making extensive changes to your database file structure from within CREATE/MODIFY SCREEN, use the following method: COPY STRUCTURE TO USE CREATE/MODIFY SCREEN >>> CREATE/MODIFY VIEW 1. You cannot permanently delete a filter formula in MODIFY VIEW. It appears to allow you to delete the filter and then SAVE the VIEW, but the next time MODIFY VIEW is invoked with the same (.VUE) file, the original filter formula will still be there. The only way to delete the filter formula is to SET VIEW TO the (.VUE) file, SET FILTER TO, and CREATE VIEW FROM ENVIRONMENT. 2. You cannot include a file from any subdirectory other than the current directory using CREATE VIEW FROM ENVIRONMENT. The default alias name is included in the view file, returning "Alias already in use" when the file is accessed with the SET VIEW TO command. >>> FIND You may receive the message "No find" when you use FIND with a macro (&) and in-line comments (&&) even though there are matching records in the index file. FIND works correctly if the macro variable contains the entire key value, or if the key contains an embedded space and the variable contains key information up to the embedded space. For example, if the key field contains "FIRST" or "FIRST LAST," the commands x = "FIRST" FIND &x && This is a comment. execute correctly. If, however, the variable contains "FIR," the example above returns the message "No find." Terminating the macro with a period does not change the result. To include in-line comments with a FIND and a macro, the comment must begin flush against the macro or terminator. For example, x = "FIR" FIND &x && This does not work. No find. FIND &x. && This does not work either. No find. FIND &x&& This works. FIND &x.&& This works, as well. >>> FOUND() If you have SET DELETED ON and perform FIND or SEEK on a key with multiple occurrences, where the first occurrence is deleted, the FOUND() function will return a .F., even though a matching record has been found. The same test can be made with the EOF() function. After the SEEK or FIND command, EOF() will return a true value (.T.), if there is not a match. >>> INDEX INDEX or REINDEX may produce the error message "File is not accessible" and damage index files in use. This occurs when the length of the key field and path to the .NDX file exceed 100 characters. This does not occur with small database files, but adding records eventually produces the error. For example, if the key length is 85 characters, INDEX ON TO \Division\Three returns the error message "File is not accessible," where INDEX ON TO \Division\Four creates the index file as expected. The first path name is 15 characters and the second path name is 14. The length of the filenames and directory names are not important individually as long as the combined length of the path name does not exceed, in this example, 14 characters. Note that, not all key expression and path name combinations exceeding 100 characters produce this error. >>> INDEX The SET CENTURY ON command and the DTOC() function are not compatible for the purpose of creating an index file. INDEXing ON the DTOC() of a date field with SET CENTURY ON will appear to index the file correctly. The file may be accessed, the FIND or SEEK commands may be used, but any attempt to BROWSE, >>> ON ERROR ON ERROR does not execute correctly if TALK is ON and you encounter an error using LOCATE. The situation occurs when two workstations are using the same database file. For example, workstation one locks record five and then workstation two executes the following commands: ON ERROR ? "This is an error" SET TALK ON LOCATE FOR RECNO() = 10 LOCATE encounters record five as locked and returns the error message, "Record is in use by another." The ON ERROR statement is not executed. To work around, SET TALK OFF, and then ON ERROR executes as expected. Protect sometimes creates encrypted .CRP files with embedded end-of-file characters. The original .DBF file, however, is not affected. At times, it appears that encrypting a 1000 record database file creates a .CRP file with between one and four embedded end-of-file characters. To work-around, first COPY the STRUCTURE of the database file you want to encrypt. Then in Protect, encrypt this new and empty database file. When you return to the Administrator, USE the empty .CRP file and then APPEND FROM the original database file containing your data. The result is the same as encrypting the original database file directly. >>> READ dBASE III PLUS stops execution when you issue a READ command with no active GETs until you press a key. When this happens, the cursor is positioned to the right of its last screen position. >>> READKEY() CompuServe ASH-1727 If a full-screen operation is terminated by Ctrl-W or Ctrl-End in dBASE III PLUS, the READKEY() function will always return the value 270, regardless of whether the contents have been altered or not. The READKEY() function should return a value of 14 if any of the pending GETs were not changed and Ctrl-W or Ctrl-End was pressed. The Developer's Release, READKEY() returns the expected value 14. >>> REINDEX 1. Occasionally, SET INDEX TO works, but a subsequent REINDEX returns the error message "File is not accessible." Other times, SET INDEX TO appears to work, but a GOTO returns the error message "Record is not in index." 2. On rare occasions, SET TALK has been shown to affect REINDEXing large database files returning the error message "File is not accessible." If you subsequently USE the database file with the index, the error message "Index damaged. REINDEX should be done before using data" is returned. If SET TALK is ON, however, REINDEX may work properly. >>> SET If SET HELP is ON, and an error occurs with any SET command, responding "Yes" to the HELP prompt returns the HELP screen relevant to the full-screen SET command, not the specific command that caused the error. >>> SET CATALOG TO 1. If you SET CATALOG TO when the maximum number of files is already open deletes all entries from the catalog, except those referring to files currently open. 2. If you SET PATH TO to the root directory of any drive, SET CATALOG TO returns the error message "File is not accessible," if it must create a catalog file on a directory other than the default directory. For example, .SET PATH TO B:\ * ---dBASE III PLUS is not on the root directory. * ---C:\Test.CAT does not already exist. .SET CATALOG TO C:\Test File is not accessible. <---Error message. >>> SET COLOR TO If SET STATUS is OFF and SET SCOREBOARD is ON, issuing the SET COLOR TO command from the dot prompt paints the SCOREBOARD area with the new color. Line 0 to the left of the SCOREBOARD area remains in the old color. Scrolling the screen will not paint the left half of line 0 with the new color. Issue a CLEAR, @ 0,0, SET STATUS, or SET SCOREBOARD command to paint that area of the screen with the chosen. >>> SET FILTER TO The following sequence of commands places your workstation in an endless loop, requiring you to warm boot your computer. SET EXCLUSIVE OFF USE SET FILTER TO GO TOP EDIT The first EDIT screen appears and you can EDIT the record. Once, however, you reach the last record that matches the FILTER condition, a PgDn or any other key that advances to the next record places your workstation in an endless loop. To work-around, USE EXCLUSIVE or with an index file. >>> SET HISTORY TO SETting HISTORY TO a number greater than the default of 20 interferes with DISPLAY HISTORY. The message "Press any key to continue..." appears, sometimes repeatedly, before the commands in HISTORY are displayed. The message also appears intermittently as HISTORY scrolls. >>> SET MESSAGE TO SET MESSAGE TO accepts any length message, although only the first 79 characters display. >>> SET PRINT ON There have been reported instances of the "Printer not ready" error message appearing on parallel as well as serial printers. This occurs when you use SET PRINT ON, SET DEVICE TO PRINT, TO PRINT, or SET PRINTER TO to output to the printer. Printing from DOS or other software packages works properly. There is no work-around if you experience this condition consistently. >>> SET PRINTER TO 1. SETting PRINTER TO a serial port works only intermittently. Any attempt to SET PRINTER TO COM1 or SET PRINTER TO COM2 may return the error message "Printer not ready" although the printer is on-line and ready to print. The work-around is to use the RUN command to load the resident portion of PC-DOS MODE into memory. For example, RUN MODE LPT1=COM1 This work-around may fail, however, you running under COMPAQ DOS. 2. Issuing SET PRINTER TO with no parameters stops all subsequent output to the printer. Commands such as LIST TO PRINT and REPORT FORM TO PRINT echo to the screen but do not print. In fact, while DISPLAY STATUS shows that output is assigned to the default port, LPT1, it has not been assigned to any device and therefore no printing can occur. A SET DEVICE TO PRINT may appear to freeze the computer, but you are still fully functional, except that no data is being output to the printer. To resume, SET PRINTER TO . 3. With a serial printer properly configured with MODE, if a SET PRINT ON command is issued, a later SET PRINT ON or SET DEVICE TO PRINT command return the "Printer not ready" error message. SET PRINT OFF must be issued first. SET DEVICE TO PRINT followed by SET PRINT ON works as expected. This problem does not occur with a parallel printer. >>> SET UNIQUE ON INDEXing with SET UNIQUE ON or INDEX ON UNIQUE works with small database files (less than 100 records), but fails in one of several ways when INDEXing larger database files. 1. INDEX with UNIQUE may seem to execute properly, but creates an index file that is neither unique nor complete. 2. INDEXing UNIQUE can freeze the computer causing one lost cluster on the disk. This leaves behind two files, an .NDX file containing 0 bytes and a larger .W44 file. The .W44 file is a temporary file created during the indexing process. Under normal circumstances, it is deleted when INDEX terminates. 3. INDEX with UNIQUE sometimes does not freeze the computer, but continues to create an index file until all the available disk storage is consumed, generating a "Disk is full" error message. If an INDEX ON UNIQUE command seems to take an inordinate amount of time and you suspect that it is runaway, press Esc to terminate the INDEX command operation and ERASE the incomplete .NDX and .W44 files. >>> TOTAL If you TOTAL ON TO with a database file that has no numeric fields, you may get an "Internal error: EVAL work area overflow" or "Internal error: Illegal opcode" error message. The resultant file is created and control returns to the dot prompt. Occasionally, this type of TOTAL operation returns the error message "Internal error: EVAL work area overflow", the DOS error message "Divide overflow," and then the computer freezes, requiring a cold boot. >>> TRANSFORM() If you use TRANSFORM() with an argument combining the @( and @B functions, displays extraneous characters following the output. For example, ? TRANSFORM(-10,'@(B9999') (10.00 )) <---Result. The extra characters may be another parenthesis, a field name, or the argument from a previous function. *--------------------------------------------------------------------------* dBASE III PLUS Corrections in dBASE III PLUS 1.1 dBASE III PLUS 1.1 Fixed Anomaly List This document lists the anomalies reported on dBASE III PLUS 1.0 that have been fixed for version 1.1. The format of these items is a list of problems. Each of the problems has been addressed by version 1.1, though this document does not say how. In most cases, the fix would bring the software into agreement with the product documentation, and our design spec. In some cases, the exact fix may not be obvious, and so an expanded list of bugs and their specific fixes would be useful. Such a list will replace this one in the near future. Until then, this is what we have. In a sense, this is a list of "negations", since nothing in this list should still be true! ---Kent Primary Sysop August 26, 1986 ---------------------------------------- >>> @ GET / RANGE Pressing the SPACE bar does not clear the RANGE error message if STATUS is ON. dBASE III PLUS Reference Notes >>> "File is in use by another" The message "File is in use by another" results from an attempt to USE a read-only database file with single-user dBASE Administrator. To avoid this situation, use PROTECT to prevent editing of database files rather than making the files read-only. >>> 43-Line Mode Using the Enhanced Graphics Adapter Users of dBASE III PLUS who have the IBM Enhanced Graphics Adapter and Display will notice that this hardware is supported but not documented. If you enter the full-screen configuration SET at the dot prompt and select the Color menu, you will notice that instead of "Color" or "Monochrome," "EColor25" and "EColor43" will be shown. You can toggle between the regular 25-line mode and the IBM Enhanced Graphic Adapter's special 43-line mode by pressing the Return key. Once in the 43-line mode, dBASE III uses all 43 lines of the screen in all display modes. This includes regular display commands such as LIST or DISPLAY, as well as full-screen commands such as APPEND, EDIT, BROWSE, @..SAY, @..GET. Unfortunately, no command in dBASE III PLUS can toggle modes, other than the full-screen SET command. In order to take advantage of this undocumented feature, set the switch settings on the IBM Enhanced Graphic Adapter should be as follows: SWITCHES 1 2 3 4 Off On On Off For more information on using of the IBM Enhanced Graphic Adapter, consult the manual provided with the card. >>> @...SAY >>> @...SAY [dBASE III PLUS] When sending control codes to the printer with @...SAY, control codes are counted as characters by dBASE III PLUS although these characters are not printed by the printer. This causes the print position coordinates for following @...SAY commands to the same line to be offset left by the number of control code characters sent to the printer. For instance, if one control character is sent to row 5, the column coordinate on row 5 will be less by one. @ 5,0 SAY CHR(15) @ 5,12 SAY "Test" will print "Test" starting at column 11. The control codes for the following example are for the C-Itoh 8510A printer. SET DEVICE TO PRINT @ 5,5 SAY CHR(27) + '!' + 'Test' + CHR(27) + '"' ^------^-----------------^------^ |--- Each character takes one space. This prints the word "Test" in boldface and sets the type back to normal. @ 5,50 SAY "Test" <------- Prints at column 46. @ 6,50 SAY "Test" <------- Prints at column 50. Press for more ! CompuServe ASH-1745 >>> @..SAY/GET With SET SCOREBOARD ON, an @...SAY to line 0 in a format file will not write in the scoreboard area, but an @...GET will read from this area. This is consistent with previous versions of dBASE III. However, the larger size of the SCOREBOARD area in dBASE III PLUS increases the likelihood of conflict between SET SCOREBOARD ON and @...SAY...GET. >>> Access Disk >>> ACCESS DISK [dBASE III PLUS - Multi-User] Because of a disk manufacturing error in which a unique access code was not recorded on System Disk #1 and System Disk #1 Back-up of dBASE III PLUS, Ashton-Tate implemented an exchange policy for the affected products. The serial numbers of the affected products are 2500001 through 2533960. Copies of dBASE III PLUS with other serial numbers are fully functional and are not affected. The defect involves only local area network use. It does not affect functionality or data integrity of dBASE III PLUS when used in its stand-alone, single-user mode. The problem was created when a special access code that permits dBASE III PLUS to be networked with other copies of dBASE III PLUS was not placed on System Disk #1 and System Disk #1 Back-up. All other disks packaged with the product are not affected. >>> Accessing Filenames with No Extensions In dBASE III PLUS, you can now access and create files with no extensions. To access or create such a file, use the double period (..) in place of the extension. For example, you can access an external file with no extension in the APPEND FROM command. Virtually all dBASE III PLUS commands that operate on files support this capability. The following list of command lines show a number of ways to work with these files. * ---Import a file with no extension. APPEND FROM Yourfile.. SDF * ---Export a file with no extension. COPY TO Yourfile.. SDF * ---Open a database file with no extension. USE Yourfile.. * ---Rename a file with no extension. RENAME Yourfile.. TO Yourfile.TXT Note that DIR does not respect the (..) notation. You must instead use the standard wildcard notation. >>> APPEND FROM Beginning with the Developer's Release of dBASE III, APPEND FROM [DELIMITED] will import delimited files without delimiters. Formerly, delimited files without delimiters would be erroneously APPENDed into the current database file. >>> ASSIST 1. In any of the submenus of the Update, Position, Retrieve, or Organize menus that support the building of search conditions, when building a condition for a date type field, non-date entries are accepted as an argument for the CTOD() function without an error message. In the Developer"s Release and earlier versions this would fail to locate any date field. But since the CTOD() function in dBASE III PLUS converts non-date entries to blank dates, searching for non-date entries on date fields with dBASE III PLUS will position the record pointer at the first blank date encountered. If there are no blank dates in the database file, dBASE III PLUS will not locate any records. 2. With versions of dBASE III greater than 1.1, it is not possible to build a search condition for blank spaces from ASSIST. The Developer"s Release would return the user to ASSIST without comment when this was attempted. dBASE III PLUS will attempt to execute the command. However, when it constructs the command line, blank spaces are excluded. For example, requesting ASSIST to LIST FOR = " " actually executes: LIST FOR = "" Since all conditions are true when compared to a null string, this is identical to: LIST ALL >>> BACKUP and RESTORE You can BACKUP and RESTORE all dBASE Administrator files without concern, they are not copy-protected. The only disks copy protected in the dBASE III PLUS or LAN PACK are System Disk #1, System Disk #1 (Backup), and the Access disk. >>> CASE When using the CASE structure to branch control within your command files, there are two distinct behaviors if the either the DO CASE or ENDCASE statements are missing from the construct. 1. If a CASE statement is not preceded by a DO CASE statement, commands following the CASE statement and preceding the ENDCASE statement will not execute. In the following example, the LIST and WAIT commands do not execute but the DISPLAY MEMORY statement does. DO WHILE .T. USE Test CASE LIST <--------| WAIT <--------| Commands do not execute. ENDCASE DISPLAY MEMORY <---------- Command executes. ENDDO 2. A CASE structure without a terminating ENDCASE will terminate execution of a command file and return control to the dot prompt without an error message when the first true CASE statement executes. >>> CONFIG.DB Using the keyword COMMAND in the CONFIG.DB or loading dBASE III PLUS with DBASE alters the initial sign on. If this keyword is not included in the CONFIG.DB file and the command DBASE is used to call the program up, dBASE III PLUS will display the license agreement on the screen and immediately present the dot prompt. However, if COMMAND = is included in CONFIG.DB or if dBASE III PLUS is invoked with a command filename on the DOS command line, the sign-on message will remain on the screen for approximately ten seconds or until Return is pressed before executing the command from CONFIG.DB or DOing the specified file. >>> COPY STRUCTURE EXTENDED Sometimes you may want to make a copy of a database file structure without making an exact duplicate as you would with the COPY STRUCTURE command. As a typical situation, you might have database file that is usable, but you think has a corrupted header. You would like to COPY the database file with a new header and not have to recreate the structure by hand. With COPY STRUCTURE EXTENDED, this task can be accomplished quite easily. The following block of code shows just exactly how. * ---Create new file. USE COPY STRUCTURE EXTENDED TO CLOSE DATABASE CREATE FROM * ---COPY old file data to new file. USE APPEND FROM CLOSE DATABASE 1. Description dBASE III PLUS and its predecessors, the Developer's Release, version 1.1, and version 1.0, do not allow you to COPY a DELIMITED file without delimiters and commas separating fields. Using the WITH BLANK option, you can get an text file without delimiters but you also get a text file without commas separating fields. A standard delimited file looks like this: "field1","field2",12,.T. ^ ^ ^ | | | | | ----------- Field separator. ---------------------------- Delimiter that bounds character fields. If the external processor that you are interfacing only supports comma separated text files without delimiters, you can use the following command file to create one. The resulting text file will be in the following form: field1,field2,12,.T. To run this program, type the following command line in a command file or at the dot prompt: DO Cpdelim WITH "","",; "","" The resulting file will have a (.TXT) extension. 2. Program Example * Program ...: Cpdelim.PRG * Author ....: Christopher White * Date ......: May 1, 1986 * Note(s) ...: Program to COPY to a DELIMITED file without delimiters. * PARAMETERS dbf, ndx, condition, txtfile * ---Set environment. SET TALK OFF SET SAFETY OFF * ---Open database file to copy and define the working set of * ---records. filexp = dbf + IIF("" <> TRIM(ndx)," INDEX " + ndx,"") USE &filexp SET FILTER TO &condition GO TOP * ---Create a structure extended file. COPY STRUCTURE EXTENDED TO Temp SELECT B USE Temp * ---Find the last field that is not a memo field. lastrec = RECCOUNT() GO BOTTOM DO WHILE Field_type = "M" .AND. (.NOT. BOF()) lastrec = lastrec - 1 SKIP -1 ENDDO * ---Open output text file. SET ALTERNATE TO &txtfile SET ALTERNATE ON * ---Output records. SELECT A DO WHILE .NOT. EOF() SELECT B GO TOP * ---Output fields. DO WHILE .NOT. EOF() fld_nme = TRIM("A->" + Field_name) DO CASE CASE field_type = "C" * ---Character field. ?? TRIM(&fld_nme) CASE field_type = "D" * ---Date field. ?? STR( YEAR(&fld_nme),4 ) +; RIGHT( STR(100 + MONTH(&fld_nme),3),2 ) +; RIGHT( STR(100 + DAY(&fld_nme),3),2 ) CASE field_type = "N" * ---Numeric field. ?? LTRIM(STR(&fld_nme,Field_len,Field_dec)) CASE field_type = "L" * ---Logical field. ?? &fld_nme ENDCASE * ---Insert field separator. ?? IIF(RECNO() = lastrec,"",",") SKIP ENDDO * ---Insert record separator. ? * ---Get next output record. SELECT A SKIP ENDDO * ---Clean up. CLOSE ALTERNATE CLOSE DATABASES ERASE Temp.DBF RETURN * EOP Cpdelim.PRG >>> CREATE FROM The CREATE FROM command is used to create a database file from a database file that contains the target database file structure as records. This a very useful but not well understood aspect of dBASE III PLUS. It can be used as a vehicle for transferring file structures from other processors such as spreadsheets, word processors, and mainframes. As an example, your mainframe consultant could add the target dBASE III database file structure as a delimited file to the download package he sends you. It then would be an easy matter to CREATE the target database file structure FROM the extended structure definition, and then APPEND FROM the downloaded delimited data file. Quite nicely this would free you from knowing or having to CREATE the target database file structure yourself. If this prospect intrigues you, the structure of the delimited extended file must be as follows: Field Field Name Type Width Dec 1 Field_name Character 10 2 Field_type Character 1 Press for more ! CompuServe ASH-1771 3 Field_len Numeric 3 4 Field_dec Numeric 3 ** Total ** 28 Each record of the delimited extended file must have fields equivalent to the one listed above. The file should be a standard delimited file obeying all the rules of the delimited file structure. The following demonstrates what a typical delimited extended file looks like. ---------------- Field name | --------- Data type | | ----- Field length | | | v v v v -- Number of decimal places if numeric "Field_one","C",15 "Field_two","N",10,2 To import this structure into dBASE III PLUS and translate it into a database file structure, perform the following steps. * ---Create mechanism for structure translation. USE COPY STRUCTURE EXTENDED TO Temp USE Temp ZAP * ---Bring the structure to translate into the mechanism. APPEND FROM DELIMITED USE * ---Translate your structure into a database file. CREATE FROM Temp ERASE Temp.DBF >>> Debugging Install Problems There are several commands in dBASE III PLUS that can assist in debugging installation problems. The following is a list of command and debugging strategies. 1. Is the dBASE Administrator running under a network? The dBASE Administrator can run in single-user or LAN mode. Use the command DISPLAY USERS to test if dBASE Administrator is operating under a network. In single-user mode, DISPLAY USERS returns no messages. In LAN mode, it lists the current users in the system. 2. Are you executing dBASE III PLUS or the dBASE Administrator? The VERSION() function can be used to determine this. It returns either "dBASE III PLUS version 1.0" or "dBASE Administrator version 1.0" depending on what software you are running. 3. What operating are you running under? The OS() function can help you determine this information. It returns the version of DOS you are running under. Note, however, it does return any network information. 4. What is read-write status of a file? The DOS 3.1 command ATTRIB can be used to display the read-write status of the specified file. If there is an uppercase R in front of the filename, the file is read-only. If there is no uppercase R, then the file is read-write. If you are operating on Novell, use the Novell FLAG command. It functions similarly to ATTRIB but lists more detailed information about the file's attributes. 5. What is the lock status of shared files? The IBM PC-NET command NET FILE, if executed on the server, will list information on the lock status of shared files. 6. What logical drives are assigned on the network? The IBM PC-NET command NET USE, lists all logical drives assigned to that user. The Novell command MAP the is equivalent command for NET USE on Novell. >>> DO WHILE In versions of dBASE III earlier than the Developer's Release, the DO WHILE command will stop evaluating it's condition as soon as the expression is complete, ignoring characters beyond that point. This makes it possible for conditions with a seemingly invalid expression to be executed. For example, DO WHILE EOF() = .T. DO WHILE EOF() = .F. both equal DO WHILE EOF() and, DO WHILE .T. = EOF() equals DO WHILE .T. DO WHILE .F. = EOF() equals DO WHILE .F. In the Developer's Release and dBASE III PLUS the above conditions will return the error message, "Invalid operator." >>> Documentation Error 1. Page 5-25 of the Networking section of the dBASE III PLUS Reference Manual shows the following command line. CASE ERROR() = 158 This command is supposed to trap the "File is in use by another" condition. The error number, however, is incorrect and the command line should read: CASE ERROR() = 108 2. There are coding errors on pages 4-18, 5-27, and 5-30 of the Networking section of the dBASE III PLUS Reference Manual. The command line, IF TIME = 250 purports to test if an attempt to lock a database file failed. It is not, however, a reliable coding method and should be changed to IF .NOT. FLOCK() 3. On page 4-18 of the Networking section of the dBASE III PLUS Reference Manual, the command times = 1 should be inserted immediately before the SKIP command. The routine on the following page is an error handling routine executed if SKIP encounters a locked record and expects the variable, times, to be reset each time it is called. 4. On page 5-30 of the Networking section of the dBASE III PLUS Reference Manual, the UNLOCK command should be placed after the READ command. >>> For 256K Machines dBASE III PLUS runs with PC-DOS version 2.xx if you have 256K installed memory in your computer. If you have a minimum of 384K of installed memory, dBASE III PLUS runs with PC-DOS version 3.xx as well as version 2.xx. For 256K operation, two files are provided, CONFI256.SYS and CONFI256.DB, on System Disk #1. These two files set system parameters for maximum overall performance of dBASE III PLUS in a 256K environment. The CONFI256.SYS file contains: FILES = 20 BUFFERS = 4 Copy the CONFI256.SYS file to the root directory of the disk you boot DOS from or the directory set by the DOS COMSPEC command and rename it to CONFIG.SYS. If CONFIG.SYS already exists, modify the file to include FILES = 20 and BUFFERS = 4. The CONFI256.DB file contains: COMMAND = ASSIST STATUS = ON BUCKET = 1 GETS = 35 MVARSIZ = 3 HISTORY = 10 TYPEAHEAD = 10 Copy CONFI256.DB into be placed in the same directory as DBASE.COM and rename it to CONFIG.DB. The CONFI256.DB settings reduce the memory-intensive parameters allowing dBASE III PLUS to work in a 256K environment. The smaller settings place the following limitations on dBASE III PLUS. MVARSIZ is reduced to 3,000 bytes which is half the normal default size of 6,000 bytes. This reduces the amount of space available for memory variables and may cause incompatibilities with programs written with earlier versions of dBASE III. Refer to the SAVE and RESTORE commands for ways to optimize use of memory variable space. BUCKET size is reduced to 1,024 bytes, half the normal default size. This reduces the amount of memory available for the PICTURE and RANGE options of the @...GET command, and may cause incompatibilities with programs written with earlier versions of dBASE III. CREATE SCREEN is limited to one screen, with a maximum of 35 pending GETs. Format files created on machines with more memory may not work when moved to a 256K machine. The limitation of 35 pending GETs may also cause incompatibilities with programs written with earlier versions of dBASE III. The RUN command is not supported on computers with 256K of memory. dBASE III PLUS requires 256K, the RUN command requires additional memory for COMMAND.COM plus the memory required by the external program. This is consistent with earlier versions of dBASE III. The "Insufficient memory" message is an indication that some memory must be released to allow dBASE III PLUS to continue with the operation. When using dBASE III PLUS with 256K RAM this message may result from a combination of factors and varies with the size and number of database files, index files, format files, and the HISTORY and TYPEAHEAD buffer sizes. If the "Insufficient memory" message is received: 1. Ensure that you are using the correct CONFIG.SYS and CONFIG.DB files, as listed above for 256K operation. 2. Close one or more open files and then proceed. Increasing the amount of RAM in your computer will significantly enhance the performance of dBASE III PLUS. >>> INKEY() 1. The INKEY() function in the Developer's Release and dBASE III PLUS seems to return the wrong answer after a WAIT command has been executed. For example, WAIT i = INKEY() ? i The memory variable "i" will always contain the value zero no matter what key was last pressed. The reason for this is that WAIT pauses and waits for a key value from the keyboard or type-ahead buffer. Once the key is sensed, it is taken from the buffer. The INKEY() function also looks at this buffer for a key, but finds that the last key has been taken by the WAIT command and so returns a zero value. The correct method to poll the keyboard for a key press is to use either the WAIT command or the INKEY() function but not both in combination. For example, * ---Use the WAIT command. WAIT TO choice DO CASE CASE choice = 19 ... CASE choice = 27 ... ENDCASE * ---Use the INKEY() function. key = INKEY() DO WHILE key = 0 key = INKEY() ENDDO DO CASE CASE key = 19 ... CASE key = 27 ... ENDCASE 2. The following program can be used to help you determine the key code for each key pressed. SET ESCAPE OFF SET TALK OFF esc = 27 DO WHILE .T. key = INKEY() DO WHILE key = 0 key = INKEY() ENDDO ? key IF key = esc EXIT ENDIF ENDDO SET TALK ON SET ESCAPE ON RETURN >>> INPUT The INPUT command behaves differently in different versions of dBASE III. In versions 1.0 and 1.1, it accepts a carriage return as a valid response and does not create a variable. If one exists, it is left intact. Control is then returned to the calling program or the dot prompt. In the Developer's Release and dBASE III PLUS, however, INPUT does not accept a carriage return as a valid response. It scrolls the screen up one line and awaits valid input each time a carriage return is entered and control is not returned to the calling program or dot prompt until a valid input is accepted. >>> Interactive Mode In dBASE III PLUS, you cannot continue command lines issued at the dot prompt with a semicolon. Previous versions supported this feature. To continue a line beyond the width of the screen keep typing and the command will scroll left. In dBASE III PLUS, the command line is an editable 254 character, single line, horizontal scroll space. All keys that are valid in full-screen modes are valid at command line. >>> LIST The LIST command is designed to display "Record in use by another" if a record is locked by a different workstation with RLOCK(). This performs according to expectation unless record number 1 is locked with RLOCK(), in which case blank data is displayed for the record. There is no work-around for this situation. >>> MODIFY STRUCTURE 1. MODIFY STRUCTURE generates the error "NET 803: Network path not found" if the database file is in the root directory of any physical drive or logical drive. Even if network drive F: is attached to the subdirectory \DBASE on the file server, it is still belongs to the logical root directory of drive F:. The work-around is to move the file to a subdirectory or COPY TO Temp MODIFY STRUCTURE After receiving the "NET 803" error message, the user must press A to abort. The database file structure will have been modified but zero records will remain in file, then APPEND FROM Temp 2. MODIFY STRUCTURE generates the error "File is already open" if the database structure contains a memo field and there are no records in the file. The work-around is to add one blank record to file. >>> Precedence of File Attributes Page 3-24 of the Networking section of the dBASE III PLUS Reference Manual states that "File and field privileges can be used to override the file access read/write attribute established at the operating system or network shell level." This is incorrect. Attributes of directories and files established at the network level always have precedence over the dBASE Administrator Protect mechanism. >>> REPLACE In addition to the ability to change the contents of fields in work areas other than the currently selected one by creating a global field pool with SET FIELDS TO and then REPLACEing into the remote area, you can also REPLACE into the remote area by specifying the alias before the target field name. For example, * ---REPLACE with SET FIELDS. SELECT 1 USE Fileone SELECT 2 USE Filetwo SET FIELDS TO Fileone->Fieldone, Fieldtwo REPLACE Fieldone WITH Fieldtwo * ---REPLACE without a fields list. SELECT 1 USE Fileone SELECT 2 USE Filetwo REPLACE Fileone->Fieldone WITH Fieldtwo >>> RESTORE The dBASE III Reference Manual for all versions incorrectly states about the RESTORE command that any memory variables STOREd as PUBLIC remain PUBLIC if the ADDITIVE option is used. The ADDITIVE option to RESTORE will allow the user to RESTORE variables as PUBLIC only if they are declared PUBLIC before the RESTORE FROM ADDITIVE command is issued. If the variables are not explicitly declared PUBLIC, they will be RESTOREd as PRIVATE variables, regardless of their status when STOREd and SAVEd. For example, PUBLIC one, two STORE 1 TO one, two SAVE TO Mem CLEAR ALL RESTORE FROM Mem ADDITIVE <-- Variables are RESTOREd without being redeclared PUBLIC. will create PRIVATE variables "one" and "two," while, PUBLIC one, two STORE 1 TO one, two SAVE TO Mem CLEAR ALL PUBLIC one, two <-- Variable is redeclared PUBLIC. RESTORE FROM Mem ADDITIVE creates PUBLIC variables "one" and "two." >>> SET COLOR The SET COLOR TO command changed somewhat in the Developer's Release and dBASE III PLUS. Formerly, colors could be referenced by number or letter code. With the Developer's Release and dBASE III PLUS, only letter codes are accepted. Additionally, there are several new options. Black can now be referenced with the letter code N, inverse video with the letter code I, and the screen can be blanked with the code X. The following table shows all the default color attributes for dBASE III from version 1.0 through dBASE III PLUS. Color Attribute Table Developer's Release dBASE III dBASE III PLUS Color Letter Number Letter Only Black 0 | N or Blue B 1 | B Green G 2 | G Cyan BG 3 | BG Red R 4 | R Magenta BR 5 | BR Brown GR 6 | GR White W or RB 7 | W or RB Other Blank | X Blinking * | * High intensity + | + Inverse video | I Underline U | U Three other capabilities are added to color in dBASE III PLUS. First, there is a new function, ISCOLOR(), that returns a true value (.T.), if your monitor is in color mode. Second, SET COLOR supports a toggle syntax, ON/OFF, to toggle your monitor between color and monochrome modes, if your machine supports both. Lastly, a background option is added for machines that cannot set the background of individual characters with the standard and enhanced options. >>> SET DATE FRENCH The format of date variable display varies between versions 1.1 and the Developer's Release and dBASE III PLUS, when SET DATE is FRENCH. For example, Developer's Release Version 1.1 dBASE III PLUS SET DATE FRENCH DD.MM.YY DD/MM/YY The Developer's Release and the dBASE III PLUS displays are identical to SET DATE BRITISH. >>> SET DELETED ON SET DELETED ON can affect the FIND command when there is more than one record in the database file with the same index key. For example, suppose there are two "Johnsons" in the database file. The first is marked for deletion and the second is locked with RLOCK() at a different workstation. If SET DELETED is ON, and you try to FIND "Johnson", you will get the message "No find" instead of the expected "Record is in use by another." Under any other circumstance, a FIND on a record locked with RLOCK() returns the message "Record is in use by another" and positions the record pointer to that record. There is no work-around at this time. >>> SET FIELDS TO Issuing the SET FIELDS TO command automatically SETs FIELDS ON, regardless of the FIELDS status prior to issuing the SET FIELDS TO command. The dBASE III PLUS Reference Manual states on page 5-169 of the Using section, under the SET FIELDS TO command, "The list of fields is not active unless the SET FIELDS command is ON." This statement implies that the command SET FIELDS ON must be executed explicitly to activate the current field list after creating it. Anytime the command SET FIELDS is executed either to create a fields list or to add to one, FIELDS are SET ON. >>> SET ORDER TO You must reposition the record pointer after executing SET ORDER TO in dBASE III PLUS. The easiest way to do this is to issue the command: GO RECNO() This will cause the record pointer to reposition itself to the current record position updating the internal record pointer. If, however, EOF() returns true (.T.), this won't work. In this case, use the following command: GO IIF(EOF(), RECCOUNT(), RECNO()) >>> SET RELATION TO Throughout the documentation for dBASE III PLUS, there is some ambiguity about the various ways you can link database files with SET RELATION TO. SET RELATION TO relates two database files in three different ways. 1. You can relate two database files with a key expression allowing you to create connections between database files based on value. It is important to stress that you are not confined to a single common field. The linking expression can be any legitimate dBASE III PLUS expression. To work, the key expression must return a value from the source work area that matches a value in the master index file of the target work area. Because the relation is created by an expression, you can take two dissimilar database file structures that contain common values and create a relation between them. In exactly the same way, you can create a relation between database files that have common fields. In both cases, the mechanism is the same: the relation is created by an expression. 2. Another way to relate database files is by record number. This type of relation allows you to link two database files having no common field values but have a one-to-one relation based on physical position. Record one in the source corresponds to record one in the target file and so on. Generally, you will use this formulation to create a virtual database file where you need a number of fields greater than the dBASE III PLUS limit of 128 per database file. When the record pointer moves in the source database file, the record pointer in the target moves to the same record number as the source record. For example, * ---Setup and syntax with a physical relation. SELECT B USE File2 SELECT A USE File1 INDEX File1 SET RELATION TO RECNO() INTO File2 * ---List records from File1 and File2. DO WHILE .NOT. EOF() ? Field1, Field2, File2->Field1, File2->Field2 * ---Advance File1 and File2 pointer. SKIP ENDDO * ---Setup and syntax with no relation. SELECT B USE File2 SELECT A USE File1 INDEX File1 * ---List records from File1 and File2. DO WHILE .NOT. EOF() ? Field1, Field2, File2->Field1, File2->Field2 * ---Advance the File1 pointer. SKIP * ---Advance the File2 pointer. recpos = RECNO() SELECT B GO recpos SELECT A ENDDO In order to build various index sort orders, put all of your key fields in the master database file as the diagram below indicates. This is important since a relation based on RECNO() precludes the use of an index file in the target work area. Master -----> Sub1 ------> Sub2 (Keys) (Non-keys) (Non-keys) 3. The last type of relation is a physical link between database files based on a numeric expression. If the linking expression evaluates to numeric and the target database file is not INDEXed, then the target record pointer moves to the record number returned by the linking expression each time the source database file pointer moves. For example, the following linking expression relates two unINDEXed database files so each pair of adjacent records in the source database file points to a single record in the target file. IIF(MOD(RECNO(),2)=1,INT(RECNO()/2)+1,INT(RECNO()/2)) Record numbers one and two in the source point to record number one in the target, three and four in the source point to two in the target, and so on. This type of relation can be used to build virtual data structures based on a link that is a combination of value and physical location. In general, it is important to your mastery of dBASE to understand the truly dynamic nature of relating database files with SET RELATION TO. For more information on SET RELATION TO, refer to the page D3-11 of the April 1985 issue of TechNotes. >>> SET RELATION TO In versions 1.0 and 1.1 of dBASE III, a relation could be released with the command SET RELATION. In the Developer's Release and dBASE III PLUS, this command returns a syntax error although it releases the RELATION. The proper and supported command syntax to release a relation is SET RELATION TO. >>> SET SCOREBOARD/SET STATUS The SET SCOREBOARD ON/OFF and SET STATUS ON/OFF commands will clear the entire screen when issued in dBASE III PLUS. In previous versions, SET SCOREBOARD ON/OFF would affect only the SCOREBOARD area of the screen. >>> SET VIEW TO If any change has been made to any of the component parts of a view, invoking that view file with SET VIEW TO will return an error message. The specific message will depend on the error in the view file. For example, if the name of field in the fields of the view has been changed by MODIFYing the STRUCTURE of one of the constituent database files, issuing the SET VIEW TO command will return "Variable not found." Once this condition has occurred, there is no way to open the view file and modify it, as MODIFY VIEW will return the same error message. The file must be deleted and re-created, or the environment must be made consistent with the view file once more. >>> UPDATE If you are trying to UPDATE one database file from another and the relation between them is many-to-one, you may have found that the UPDATE command does not support this formulation. The UPDATE command only updates the first instance in the target database file. This means that the UPDATE command is useful only when the relation between the source and the target database files is one-to-one. To update your many-instance file from the single-instance file, use the REPLACE command in combination with SET RELATION. For example, SELECT 2 USE INDEX SELECT 1 USE INDEX SET RELATION TO INTO REPLACE ALL WITH ->,; WITH ->,; WITH -> the target file and so on. Generally, you will use this formulation to create a virtual database file