10.14.13 Setting Report Attributes (SET)

Syntax

PAGELENGTH

PAGEWIDTH

FIRSTLINE

SET LASTLINE := EXPRESSION [, ...];

MAXPAGES

SKIPPAGES

TRACE

NOOUTPUT

The following table shows what each attribute controls and the default setting:

PAGELENGTH page length in lines (default=66)

PAGEWIDTH page width in columns (80)

FIRSTLINE first line of page to print on (3)

LASTLINE last line of page to print on (63)

MAXPAGES last page number to print to (-1: no limit)

SKIPPAGES number of pages to skip (0)

TRACE turn on or off program trace feature.

($FALSE): off.

NOOUTPUT suppress error message if no output is generated (0: print error)

Purpose

Report attributes control how a report will be printed. By changing these attributes, a program can print on any style of form. Report attributes should be set before any other statements are executed. See the section on debugging for a description of the program trace feature.

PAGELENGTH controls how many lines there are on one page. When this attribute is changed, LASTLINE will usually need to be changed also.

PAGEWIDTH controls the maximum number of columns that will be printed across the page. Print lines longer than PAGEWIDTH will be split and printed on multiple lines.

FIRSTLINE controls where the first line of output will be on a new page. When a new page is started, the Report Writer will automatically skip down to FIRSTLINE before printing any output from the report program. (Skipping is done before the top of page break is processed.)

LASTLINE controls where the Report Writer will break off printing on one page and continue on the next page. This attribute will usually need to be changed when PAGELENGTH is changed.

MAXPAGES controls the maximum page number that will be output. If this attribute is greater than zero, all output will be suppressed after this page number has been reached. The Report Writer will not stop execution when this limit is reached, it merely stops report output.

SKIPPAGES controls the number of pages of output that must be generated before the Report Writer will start printing the output. Until this page number is reached, the report writer will suppress the output of the report program.

TRACE is used for debugging a report program during the development stage or when an error occurs during processing whose cause cannot be readily ascertained. More information on this attribute and its use may be found in the section of this chapter entitled Debugging and in the Report Writer Programming Guide chapter of this manual.

NOOUTPUT is the attribute set when a program normally generates no output, such as a file updating or deleting process. If this attribute is not set and the program produces no output, the Report Writer generates the message:

No data printed for this report.

Setting this attribute on ($TRUE) suppresses this message. This does not turn off report output (see SKIPPAGES attribute).

Examples:

/* set up for wide stock paper */

SET PAGEWIDTH := 132;

/* set up for mailing labels */

SET PAGELENGTH := $LABELLENGTH,

FIRSTLINE := 1,

LASTLINE := $LABELLENGTH;

/* set up for stock statements/invoices/

SET PAGELENGTH := 56,

FIRSTLINE := 2,

LASTLINE := 54;

/* turn on debugger */

SET TRACE := $TRUE;

/* no output to be generated */

SET NOOUTPUT := $TRUE;