Syntax
where is an integer representing an input
channel number; is an integer representing an output
channel number; F is a sequence of alphabetic characters representing
a valid filename; and P is a sequence of alphabetic characters
representing a path to a directory containing, or to contain, the file.
The CHANNEL: command is used to specify and attach external files,
for output and input, to the program. The first form of the syntax is
used to associate external files with input channels, of which there are
six in all. The second form of the syntax is
used to associate external files with output channels, of which there are
four in all.
If no file path P is given, the sequence of directories given by the
search path is searched in order to find the file F.
If an output channel is being declared, and if the external file cannot be
found, then it will be created, either in the current directory or in
the directory indicated by the path P if one was supplied. However, if
an output channel is being declared and the external file does exist
then its contents will be overwritten. Beware that you do not remove
precious file contents accidentally.
If an input channel is being declared, and if the external file cannot be
found, an error will be reported.
You may not associate an output channel with an external file
which is currently associated with an input channel. You may not
associate an input channel with an external file which is already
associated with an input channel. You may associate an input channel with
an external file that is already linked with an output channel (provided
that the output channel is not currently being used for output; the
attempt will result in the reporting of an error). In this case, the
external file will be closed, and the output channel linked to it
removed. Finally it is then linked to the input channel. This provides a
limited means of interactively creating macro files as outputs for
further use as inputs.