PS TEXT FORMAT Reference Manual
Introduction to TFORM
11387 Tandem Computers Incorporated 3–33
FILE OPEN
filename
WRITE PURGE
This command opens the specified file as a write-only file. If the
named file doesn’t exist, TFORM creates it. If it does exist, TFORM
purges it and opens a new file with that name.
FILE READ Option
FILE READ reads data from the specified file, assigning the contents of
one record to each variable listed in the READ command.
FILE READ
filename var
This command reads as many lines from the named file as there are
variables in the command line, assigning the string value of each
line to the next variable in turn. If the FILE READ command
reaches the end of the file before filling all the variables, it assigns
the GUARDIAN 90 file system error “1” (end-of-file) to the system
variable SYS_FILEERROR and assigns an undefined value to each
remaining variable in the list.
If the specified file hasn’t been opened as a read-only file, the FILE
READ command assigns the appropriate GUARDIAN 90 file
system error number to SYS_FILEERROR and does nothing else.
These error codes are all defined in the System Procedure Errors and
Messages Manual.
FILE READ *
var
This command reads as many lines from the current input file as
there are variables in the input list, assigning the string value of
each line to the next variable in turn. Normally, you would use
FILE READ * in a macro. If the FILE READ command reaches the
end of the file before filling all the variables, it assigns the
GUARDIAN 90 file system “end-of-file” error code to the system
variable SYS_FILEERROR and assigns an undefined value to each
remaining variable in the list. Note that no FILE OPEN command
is necessary, since the current input file is already open.
TFORM doesn’t send the lines read into variables to the printer as
well; it resumes normal formatted output with the line following
the last one read into a variable.