IB Statements/erase

From CometWiki

Jump to: navigation, search

ERASE statement

Syntax: ERASE filename [,DIR=directory] [,EXCP=statement-label | NOEXCP]

Discussion: The ERASE statement removes a specified file from a Comet directory.

Filename is the name of the file to be erased. It may be a string constant or string variable.

Directory (optional) is the name of the Comet directory where the file is located. If this parameter is not included, Comet will search the accessed directories in accessed order in an attempt to find the file. The first filename found matching the filename to be erased will be erased.

Note: A file must be closed by all users to be erased.

See CLEARFILE.

Example 1: ERASE "OLDFILE",EXCP=9999

In this example, the file named OLDFILE will be erased. (The accessed directories will be searched in order for this file.) If an exception occurs, the program will branch to statement- label 9999.

Example 2: ERASE FILENAME$,DIR=DIRNAME$,EXCP=8000

In this example, the ERASE statement is used with variable names for the filename and directoy. Values for these variables must be established before this statement is executed.

Personal tools