Listing A File; Figure 4-7 Listing A File - HP TACL Programming Manual

Tandem advanced command language
Table of Contents

Advertisement

Accessing Files

Listing a File

Listing a File
Note
4–16
Use the macro in Figure 4-7, tacllist, to format, paginate, and print TACL program
files. This macro calls #REQUESTER to read the TACL file, copies the TACL file to a
disk file designated as the OUT file in TFORM format, and then calls TFORM to
format and print the file. Tacllist displays the following:
A listing banner with the TACL file date and the current date.
The contents of the file, including line numbers and page numbers.
Figure 4-7 shows the use of a macro for a more complex set of operations. Because a macro cannot use
the #ARGUMENT built-in function, the macro must provide more argument checking capabilities. In
addition, the macro cannot use the #RETURN built-in function, so it uses a series of #IF calls. The bulk of
the code resides in the innermost #IF statement, making the program more difficult to read.
You can use the TFORM \NEW command within the TACL file to cause TFORM to
advance to the top of a new page. When you insert a directive of the form ==\NEW in
the file to be printed, tacllist replaces it with \NEW. The macro sets the page
width to 132 characters.
To preview your output before printing, specify your terminal name as the output file.
Following a preview, reinvoke tacllist to get a printed listing. To run this macro,
load the file and enter:
tacllist infilename [ outfilename ]
If outfilename already exists, TACL purges the file. If you do not specify a result
file, tacllist writes to a file called TACLTFRM.
Figure 4-7. Listing a File (Page 1 of 5)
?SECTION tacllist MACRO
#FRAME
#PUSH err_inp rec_inp prompt default_outfile
#PUSH line_num line page_num page_out bin_date file_date
#PUSH list_date year month day file_hour file_min
#PUSH list_hour list_min short_stars long_stars
#PUSH lines_out max_lines match_string printer
#PUSH #OUTFORMAT #WIDTH
#SET printer $S.#LP5
#SET max_lines
#SET default_outfile TACLTFRM
#SET #WIDTH 132
#SET #OUTFORMAT PLAIN
107365 Tandem Computers Incorporated
== Put local printer name here
55
== Set to maximum lines/page
== Default output file name
== Listing wrap column

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents