File Management Overview | Statement List
This section covers the GRIP statements used to control access to Unigraphics and scratch files. Many of these statements are imbedded in Unigraphics, 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.
NOTE: When accessing scratch files, be aware that GRIP NC CLS files
also use scratch file 1. If you attempt to write to scratch file 1 when it
already contains a CLS file, the CLS file will be lost. The following example,
using the EDA &SFNAME, allows you
to check the scratch file area for any CLS files currently in use and if so, to
file it.
.
.
.
$$ 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:
.