11. Printing of Reports

The following is a definition of the guidelines for LAS application programs to follow when a report is generated. A parameter should be included in the PDF which allows the user to send the report to the terminal screen, a line printer, and/or an ASCII file. The standard name for this parameter is print and its valid list is (TERM, LP, filename). The print parameter is used in the application program and also the fileutil procedure. The fileutil procedure is always called after the program procedure in the PDF to process the output report.

If TERM is specified, the method of output is determined by whether the output is required to be real time. If the terminal output is needed while the program is running, the utility subroutine c_pterm() is called to write a line of data to the terminal screen. Otherwise, if the terminal output can be written after the program is complete and is in the same format as a file that would be sent to the line printer, the program creates a print file as it would for the option. The fileutil procedure takes care of outputting the data from the file to the terminal screen.

If filename or LP is specified, the application program creates a single ASCII "print" file. The name of this file is the program name appended with a _time-code.pr (test_17054.pr all in lower case). Output data is written to this file during execution. Then, if LP was specified, fileutil inserts the standard header and sends the file to the printer specified by the $PRINTER global. Otherwise, for "filename" the print file is renamed from progname_time.pr to the file name specified by the user and is saved on disk.

User guide for Fileutil: