# CLEARFILE

Updated: 10/14/2021, 2:20:00 PM
Created: 10/14/2021, 2:20:00 PM
Last Updated By: mikes
Read Time: 1 minute(s)

# Description

The CLEARFILE statement is used to clear all the data from a file previously opened with the OPEN statement. It takes the general form:

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

Where:

  • The variable is the subject of an OPEN statement before the execution of CLEARFILE upon it.
  • If the SETTING clause is specified and the CLEARFILE fails, it sets setvar to one of these values.

# Note

If variable is omitted from the CLEARFILE statement, it assumes the default file variable as per the OPEN statement.

An example of use is as follows:

OPEN "record_file" TO fileVar ELSE ABORT 201, "record_file"
CLEARFILE fileVar
1
2

Go back to jBASE BASIC

Go back to Programmers' Reference Guide