Skip to content

INITFILE

Initialize File

This directive allows an existing file to be cleared of all data and still retain its original size.

INITFILE file-name [,ERR=line-ref|,ERC=error-code]
file-name
is any string of 8 characters or fewer used to identify this file.
line-ref
is the program line number or label to branch to if this directive produces an error.
error-code
is a programmer-defined error code. Valid values are positive or negative whole numbers.

This directive is generally available starting with release level 8.0.

This single directive is designed to replace several directives previously necessary to clear an existing file. For example:

INITFILE FILE**_**NAME$

replaces:

OPEN (1) FILE**_NAME$
LET FILE
_FID$ = FID (1)
CLOSE (1)
ERASE FILE
_NAME$
FILE FILE
_**FID$

If the file type is an MSORT or TISAM, XFD(1,5) is used in place of FID(1) in the statements above.

If a file-name is specified that cannot be found on the available logical disk directories, an ERR=12 results.

If a file-name is specified that is OPEN to another task or on another channel for this task, an ERR=0 results.

FILE directive
FID and XFD functions

From the Thoroughbred Basic Language Reference, Volume II: F–Q, version 8.9.1. Open this page in the PDF