HEADING Statement
Pages the current output device and prints the specified text at the top of the page.
Syntax
HEADING expression
Syntax Elements
expression is a DataBasic expression or string to be printed at the top of each page.
Operation
The page size is determined by the most recent TERM command executed at TCL. If the heading is longer than the TERM line length, the heading wraps around to the next line.
Special heading control characters can be used as part of the HEADING statement. They are:
'C{n}'Center line (in field of n characters).
'D' or \\Current date.
'T' or \Current time and date.
'L' or ]Return and Linefeed.
'P' or ^Current page number.
'PP' or ^^Current page number right-aligned in four spaces.
'N'Inhibits paging.
''Two consecutive quotes print a single quote.
When HEADING is used with the PRINT statement, all terminal output is paged (RETURN must be pressed when a full page has been printed), unless the N option is used.
HEADING statements can be changed or cleared independently, without altering the page number. The first nonnull HEADING statement issued causes a page advance and a new heading.
A HEADING statement can be cleared by specifying a null string in the statement. Unless both the heading and the footing are cleared, changing an existing heading or footing does not affect the page number.
Examples
HEADING "OUTPUT"
Advances current output device to top-of-page, and OUTPUT is printed as the page heading.
HEADING "'T' 'P' 'L'"
Advances output device to top-of-page and prints time, date and page number, followed by a Return/Linefeed.
S="JANE''S REPORT'L'PAGE'PP'" HEADING S
Advances to top-of-page and prints JANE'S REPORT, followed by a Return/Linefeed, and PAGE, followed by the current page number right-aligned in a field of 4 spaces.
HEADING ""
Clears the HEADING statement currently in effect.