HEADING

HEADING

Top  Previous  Next

 

The HEADING statement defines text to be printed or displayed at the top of each page of output.

 

 

Format

 

HEADING {NO.EJECT}  {ON print.unit} text

 

where

 

print.unitidentifies the logical print unit in the range -1 to 255 to which the heading text is to be applied. If omitted, the default print unit (unit 0) is used.

 

textis the heading text. This may include control tokens as described below.

 

 

The HEADING statement defines the text of a page heading and, optionally, control information determining the manner in which the text is output. A page heading is output whenever the first line of output on a page, including blank lines, is about to be printed or displayed. The HEADING statement normally causes subsequent output to appear on a new page. The NO.EJECT option defers the new heading until the start of the next page. The HEADING.NO.EJECT option of the $MODE compiler directive can be used to make NO.EJECT the default.

 

The heading text may include the following control tokens enclosed in single quotes. Multiple tokens may appear within a single set of quotes.

 

CCenters text on the line.

 

DInsert the current date in the form dd mmm yyyy (e.g. 25 MAR 2006)

 

GInsert a gap. Spaces are inserted in the heading line at the position of each G control token such that the overall length of the line is the same as the printer unit width. A single use of the G token will right justify the subsequent text. Multiple G tokens will distribute spaces as evenly as possible.

 

When a heading line uses both G and C, the heading is considered as a number of elements separated by the G control options. The element that contains the C option will be centered. The items either side of the centered element are processed separately when calculating the number of spaces to be substituted for each G option.

 

HnSets horizontal position (column) numbered from one. Use of H with C or with a preceding G token may have undesired results.

 

LStart a new line

 

NInhibit automatic display pagination

 

OReverses the elements separated by G tokens in the current line on even numbered pages. This is of use when printing double sided reports.

 

PnInsert page number. The page number is right justified in n spaces, widening the field if necessary. If omitted, n defaults to four.

 

SnInsert page number. The page number is left justified in n spaces, widening the field if necessary. If omitted, n defaults to one.

 

TInsert current date and time in the form hh:mm:ss mm/dd/yy

 

Unrecognised control tokens are ignored. A quotation mark may be inserted in the printed text by using two adjacent quotation marks in the text string.

 

There is no limit to the length of a heading text. Each line will be truncated at the width of the print unit. The effect of using a heading which does not leave sufficient space for at least one line of text is undefined.

 

 

See the RUN command for a discussion of how the page end pause on output to the screen may be affected by setting a page heading.

 

 
See also:

FOOTING, PAGE