Target Language Compiler    

Output File Control

The structure of the output file control construct is

%openfile

The %openfile directive opens a file or buffer for writing; the required string variable becomes a variable of type file. For example,

%selectfile

The %selectfile directive selects the file specified by the variable as the current output stream. All output goes to that file until another file is selected using %selectfile. For example,

%closefile

The %closefile directive closes the specified file or buffer, and if this file is the currently selected stream, %closefile invokes %selectfile to reselect the last previously selected output stream.

There are two possible cases that %closefile must handle:

If desired, you can append to an output file or string by using the optional mode, a, as in


  Object-Oriented Facility for Generating Target Code Input File Control