Description

Deletes all rows from a table, but retains the table structure.

Syntax

ClearFile filevar Then | Else statements

Parameters

The ClearFile statement has the following parameters.

ParameterDescription
FilevarA file variable created by a previous Open statement.
ThenThe statement(s) following Then are executed if a table is cleared successfully. For more information about the use of Then and Else, refer to "If/Then statement" description in this chapter.
ElseThe statement(s) following Else are executed if the table cannot be cleared. The Status() function indicates the severity of the error, and the system variable @FILE_ERROR contains details about the nature of the error.

See also

Delete()

Example

* The code opens a particular file, then clears it.
file = "TEST_FILE"
Open file To file_var Then
  ClearFile file_var Else
    GoSub clear_failed
  End
End
  • No labels