Asynchronous Serial Communications Programmer's Reference Manual (32022-90052)

240 Chapter9
Intrinsics Reference (cont)
FOPEN
FOPEN
Opens a file, defines its physical characteristics, and sets up access to
the file.
Syntax
I16 CA U16V U16V
filenum
:=FOPEN(
formaldesignator
,
foptions
,
aoptions
,
I16V CA CA 16V
recsize
,
device
,
formmsg
,
userlabels
,
I16V I16V I32V
blockfactor
,
numbuffers
,
filesize
,
I16V I16V I16V
numextents
,
initialloc
,
filecode
);
Use
The FOPEN intrinsic sets up access to a file and defines its
characteristics and the manner in which it may be accessed. In the
FOPEN intrinsic call, you can specify a formal file designator to be
associated with the file. This allows you to control the file through file
equations when the program is run.
When the FOPEN intrinsic is executed, it returns a file number to the
user’s process as its functional return value. Because this file number is
unique among all other file numbers currently assigned by the system
to this process, it is this file number, rather than the formal file
designator, that is used by subsequent intrinsic calls to reference the
file.
Functional Return
filenum 16-bit signed integer (assigned functional
return)
Returns the file number that will be used to identify the
opened file in subsequent intrinsic calls.
Parameters
formaldesignator character array (optional)
Passes a string to be associated with the file as its
formal file designator. The string can contain
alphanumeric characters, slashes or periods, and
terminates with any nonalphanumeric character except