CLEARFILE

Man Page Index


The CLEARFILE statement is used to clear all the data from a file previously opened with the OPEN statement.

 

COMMAND SYNTAX

CLEARFILE {variable} {SETTING setvar} {ON ERROR statements}

 

SYNTAX ELEMENTS

The variable must have been the subject of an OPEN statement before the execution of CLEARFILE upon it. If the variable is omitted from the CLEARFILE statement, then the default file variable is assumed as per the OPEN statement.

 

NOTES

The CLEARFILE statement will remove every database record on the file it is executed against. It should therefore be used with great care.

If the variable argument does not describe a previously opened file, the program will enter the debugger with an appropriate message.

If the SETTING clause is specified and the CLEARFILE fails, setvar will be set to one of the following values:

Incremental File Errors

128 No such file or directory
4096 Network error
24576 Permission denied
32768 Physical I/O error or unknown error

 

EXAMPLES

OPEN "DATAFILE" ELSE ABORT 201, "DATAFILE"
OPEN "PROGFILE" TO FILEVAR ELSE ABORT 201, "PROGFILE"
CLEARFILE
CLEARFILE FILEVAR


JBC