REMOVE |
Delete Record from File |
REMOVE (filespec[,fileopt])
Where:
filespec |
Can be a numeric expression indicating the open channel number to use or a string expression containing the pathname or table name (if string is prefixed by the keyword TABLE) of the file to use. | ||||||||||||||||
fileopt |
Supported file options (see File Options):
|
(TABLE support was added in PxPlus 2018.)
Use the REMOVE directive to delete a record from a file. The directive is only supported for file types that have keys (i.e. not for indexed files). The REMOVE directive and the specific options are dependent on the specific file type.
For Keyed, Direct Sort or ZIP files, the KEY= option is mandatory to identify the record to be removed. The key specified must be the primary key for the file. With multi-keyed files, PxPlus removes all related alternate keys from the file automatically when executing this directive.
PxPlus supports use of the REMOVE directive with ZIP files.
0010 open (20)"CSTFLE"
0020 input "What customer do we delete?",C$
0030 if C$="" then stop
0040 remove (20,key=C$,dom=0100)
0050 print "Well that's gone.."
0060 goto 0020
0100 print "Could not find ",C$
0110 goto 0020