If SET TALK is ON, and if CONTINUE finds another record meeting the con-dition, the record number is displayed. Otherwise, the message End of LOCATE scope appears, returns a logical false and the record pointer is positioned at the last record of the LOCATE scope or at the end of the file. If the record pointer is at the end of the file, returns a logical true
Example
To locate records containing in the field of the Stock data-base file:
FOR $ Descript
End of LOCATE scope
The message End of LOCATE scope indicates that no more records match the FOR or WHILE condition, or the scope of the LOCATE command.
See Also
FIND, FOUNDO, LOCATE, SEEK, SEEK()
COMMANDS
CONVERT
CONVERT adds a field to a database file's structure which holds information required for multi-user lock detection.
Syntax
CONVERT [TO expN
Usage
This command adds a character field called _dbaselock to the structure of the currently selected database file. The length of the field is determined by the numeric expression, which may be a number from 8 to 24. The default is 16.
The field reserves an area for the following values:
Count A two-byte hexadecimal number used by the function.
Time A hexadecimal number that records the time a lock was placed.
Date A three-byte hexadecimal number that records the date a lock was placed.
Name A zero- to representation of the log-in name of the computer that placed a lock, if a lock is active.
The count, time, and date portions of the field always take the first eight characters.
If you CONVERT the _dbaselock field to the of characters, the log-in name will be eight characters long. If you CONVERT the field to the maxi-m u maxi-m of 24 characters, the log-in namaxi-me will be characters long. If you CONVERT the field to eight characters, no space is reserved for the log-in name, and the name is not written in the record.
Every time a record is updated, the count portion of _dbaselock is rewritten.
If you use the CHANGE() function, the count portion of the field is read from the disk again and compared to the previous value, which was stored in mem-ory when the record was initially read. If the values are another user has changed the record, and the function returns a logical true
You can reset the value to false by repositioning the record pointer. GOTO RECNOO rereads the current _dbaselock field, and a subsequent CHANGEO command should return a false unless another user has made another change in the interim.
LANGUAGE REFERENCE 2-59
I
CONVERT
The LKSYSO function returns the log-in name, date, and time portions of the field. It indicates who has locked the record or file, and when the lock was placed. If you place a file lock, the field of the first record in the database file contains the information used by CHANGE() and LKSYSO.
Tip
CONVERT copies the file to new file with a extension, then creates a new file containing the —dbaselock field. The file contains the original file structure before CONVERT.
See Also
CHANGEO, FLOCKO, LKSYS(), SET LOCK, SET REPROCESS, UNLOCK
2-60 COMMANDS
COPY
COPY duplicates all or part of an active database file, creating a new file.
COPY is also the primary command used to export data to non-dBASE programs.
Syntax
TO filename
file type [FIELDS field list
scope [FOR condition [WHILE condition
Defaults
This command copies all records, including records marked for deletion, unless SET DELETED is ON, or unless you specify a scope, FOR, or WHILE clause to limit the records copied. All fields are copied, unless you specify a FIELDS list or use the SET FIELDS command. Memo fields are copied only if the new file is another dBASE IV database file.
A directory listing of new files created by the COPY command shows the dates on which the new files were copied.
If you do not enter a file type with the command, the file is copied to another dBASE IV database file.
Usage
If the TO file is another dBASE IV database file, do not specify
This command automatically copies m e m o files when the TO file is a dBASE IV database file. If the TO file is an ASCII text file or a file supported by another software program, specify one of the file type options.
NOTE
The COPY command does not verify that the files you build are com-patible another program. You may specify field lengths,
record lengths, number of fields, or number of records that are incom-patible with other software. Note the file limitations of your other soft-ware program before exporting database files with COPY.
I
LANGUAGE REFERENCE 2-61
COPY
Options
The options for exported file types are:
• DELIMITED — Delimited Format ASCII file. Data is appended character by character starting on the left. Each record must end with a carriage return and line feed. A comma separates each field and, in addition, dou-ble quotation marks surround character data unless you specify another delimiter. This is the same as DELIMITED WITH
• DELIMITED [WITH delimiter — ASCII text file with comma field separators and character fields enclosed within delimiter charac-ters. All fields are separated by commas. Character fields are delimited with double quotes by default, unless you specify another delimiter char-acter using the WITH delimiter option. Records in the text file are variable length, and every record ends with a carriage return and line feed.
• DELIMITED [WITH BLANK] — ASCII text file with a single space character separating each field, but with no delimiters enclosing charac-ter fields. Records in the text file are variable length, and every record ends with a carriage return and line feed.
• SDF — System Data Format ASCII file. Character data is not delim-ited, and fields are not separated with a character. Records are fixed length, the same length as the record in the database file, and every record ends with a carriage return and line feed.
• DBASEII — dBASE II database file. The dBASE II file is given a file extension, rather than a extension, to distinguish it from the original dBASE IV file. You should rename the file to include a
extension before you use it in dBASE II.
• DBMEM03 — dBASE III PLUS format for database and memo field files. Once a database file and its memo file have been cre-ated or modified in dBASE IV, they cannot be opened in dBASE III PLUS.
However, you can COPY them with TYPE DBMEM03 and open the copies.
• RPD — RapidFile data file.
• FW2 — Framework II database.
• SYLK — MultiPlan spreadsheet formula. Database records are converted to MultiPlan rows, and database fields are converted to columns. No file extension is written with the output file.
• DIF — VisiCalc version 1 file format. Database records are con-verted to VisiCalc rows, and database fields are concon-verted to columns.
2-62 COMMANDS
COPY
• WKS — Lotus 1-2-3 spreadsheet format, release Database records are converted to Lotus 1-2-3 rows, and database fields are con-verted to columns.
When COPY is used to write any of the three supported spreadsheet formats (SYLK, DIF, WKS), the field names are written as column headers in the resulting file. The file is created in row major order.
Special Cases
Use the EXPORT command, rather than the COPY command, to convert files to PFS:FILE. EXPORT and COPY both convert files to Framework II,
dBASE II, and RapidFile file formats. COPY, however, cannot create a PFS:FILE form.
Tips
Do not use the single letters A through J, or the letter M, as a database file-name if you COPY TO a dBASE IV database file. These letters are reserved as default alias names. You can, however, specify AA (for example) as a data-base filename.
If a relation is active and you have specified fields from another work area with the SET FIELDS command or with the FIELDS clause, the resultant file contains the data from related records in other work areas.
Example
To copy all the records in the Transact database file whose is C00002 to a database file called Temp:
COPY TO FOR Clientjd
2 copied
ORDERJD DATE TRANS INVOICED
1 02/12/87 1250.00
2 C00002 03/09/87
See Also
APPEND FROM, COPY FILE, COPY STRUCTURE, EXPORT, IMPORT, SET DELETED, SET FIELDS, SET SAFETY
LANGUAGE REFERENCE 2-63