IB Statements/clearfile

From CometWiki

(Difference between revisions)
Jump to: navigation, search
Line 5: Line 5:
'''Discussion:'''  The CLEARFILE statement clears all data from an open Comet data file.  
'''Discussion:'''  The CLEARFILE statement clears all data from an open Comet data file.  
-
The lun parameter is the numeric value that is assigned to the previously opened data file. The lun may be a numeric constant, numeric variable, or a symbolic constant. Its value may be from 0 through 49.  
+
The lun parameter is the numeric value that is assigned to the previously opened data file. The lun may be a numeric constant, numeric variable, or a symbolic constant. Its value may be from 0 through 99.  
The CLEARFILE statement does not remove the data file entry from the Comet directory (like the ERASE statement does); it just clears all of the data records from the file.  
The CLEARFILE statement does not remove the data file entry from the Comet directory (like the ERASE statement does); it just clears all of the data records from the file.  

Revision as of 17:35, 28 May 2010

CLEARFILE statement

Syntax: CLEARFILE (lun)

Discussion: The CLEARFILE statement clears all data from an open Comet data file.

The lun parameter is the numeric value that is assigned to the previously opened data file. The lun may be a numeric constant, numeric variable, or a symbolic constant. Its value may be from 0 through 99.

The CLEARFILE statement does not remove the data file entry from the Comet directory (like the ERASE statement does); it just clears all of the data records from the file.

History: This feature was added to CometServe32 and CometServeNLM Version 2.59.

Example: OPEN (20) "WORKFILE",DIR="DSK" . . . CLEARFILE (20) . . . CLOSE (20)

This example shows a data file named WORKFILE,DSK being opened on lun 20. The CLEARFILE statement clears all of the data from this file. At the end of the code segment, the file is closed.

Personal tools