IB Statements/erase
From CometWiki
(New page: ERASE statement Syntax: ERASE filename [,DIR=directory] [,EXCP=statement-label] Discussion: The ERASE statement removes a specified file from a Comet directory. Filename is the name ...) |
|||
Line 1: | Line 1: | ||
- | ERASE statement | + | '''ERASE statement''' |
- | Syntax: ERASE filename [,DIR=directory] [,EXCP=statement-label] | + | |
- | Discussion: The ERASE statement removes a specified file from a Comet directory. | + | '''Syntax:''' ERASE filename [,DIR=directory] [,EXCP=statement-label] |
+ | |||
+ | '''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. | Filename is the name of the file to be erased. It may be a string constant or string variable. | ||
Line 10: | Line 13: | ||
See CLEARFILE. | See CLEARFILE. | ||
- | Example 1: ERASE "OLDFILE",EXCP=9999 | + | '''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. | + | 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 | + | |
+ | '''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. | 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. |
Revision as of 09:22, 20 May 2009
ERASE statement
Syntax: ERASE filename [,DIR=directory] [,EXCP=statement-label]
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.