159
DEL_RECORD
Purpose To delete the record pointed by the file pointer in a specified DBF file.
Syntax DEL_RECORD(file% [,index%])
Remarks “file%” is an integer variable in the range
of 1 to 5, indicating which DBF file to
be accessed.
“index
%” is an integer variable in the range of 1 to 3, indicating which IDX file
to be accessed. If it is not specified, then the default IDX file which keeps the
original data sequence will be used.
For example, if DBF 1 contains four records: 011-231, 120-117, 043-
067-150.
The key (index) of the first associate IDX file is defined as starting at position 1
with length of 3, and the key (index) of the second associate IDX file is defined
as star
ting at position 5 with length of 3. All the file pointers of the DBF file and
IDX files are currently pointing to the last record. Then, DEL_RECORD(1) will
delete 067-150, DEL_RECORD(1,1) will delete 120-
117, DEL_RECORD(1,2) will
delete 011-231.
011-231 011-231 043-010
120-117 043-010 120-117
043-010 067-150 067-150
--> 067-150 --> 120-117 --> 011-231
Example
ON COM(1) GOSUB HostCommand
…
HostCommand:
Cmd$ = READ_COM$(1)
CmdIdentifier$ = LEFT$(Cmd$, 1)
DBFNum% = VAL(MID$(Cmd$, 2, 1))
IDXNum% = VAL(MID$(Cmd$, 3, 1))
CardID$ = RIGHT$(Cmd$, LEN(Cmd$)-3)
IF CmdIdentifier$ = “-” THEN
DEL_RECORD(DBFNum%, IDXNum%)
ELSE