IB Statements/erase

From CometWiki

< IB Statements(Difference between revisions)
Jump to: navigation, search
(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 ...)
 
(One intermediate revision not shown)
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 | 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.  
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.

Latest revision as of 22:07, 28 May 2009

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.