File Management Overview | Statement List


File Access

This section covers the GRIP statements used to control access to NX and scratch files. Many of these statements are imbedded in NX, such as creating, retrieving, and filing a part.

You may find the FHREAD statement to be useful when accessing a file. The FHREAD statement allows you to read the header information of a specified file in a directory. Refer to FHREAD for details.

You may find the DNEXT statement to be useful when accessing a directory. The DNEXT statement reads the header information of the next file in the directory. Refer to DNEXT for details.

Refer to Directory Access for grouped statements and their descriptions. Various statements in this section contain the terms IFEND,label: and IFERR,label:. The IFEND parameter specifies a label to which the program jumps when the end of a file or directory is reached during the specified operation. The IFERR parameter specifies a label to which the program jumps if an error occurs during the specified operation.

Example

.
.
.
$$ READ SCRATCH FILE NAME
S_NAME = &SFNAME(1,IFERR,NO_CLS:)
$$ FILE IF USER WANTS
CHOOSE/'DO YOU WISH TO FILE' + S_NAME,'YES','NO',DEFLT,1,RESP
IF/RESP < 5, JUMP/TERM:
IF/RESP == 5, FILE/TXT,1
$$ GET RID OF SCRATCH FILE
FTERM/TXT,1
NO_CLS:
.