TOP-OF-PAGE

TOP-OF-PAGE Syntax Diagram

Addition:

... DURING LINE-SELECTION

Effect

TOP-OF-PAGE is a list processing event which is executed before the first data is output on a new page.

Without the addition ... DURING LINE-SELECTION, TOP-OF-PAGE is processed only when generating basic lists, not when creating secondary lists.

Example

PROGRAM DOCUEXAM NO STANDARD PAGE HEADING. 
 
START-OF-SELECTION. 
  WRITE: / 'line 1'. 
  WRITE: / 'line 2'. 
  WRITE: / 'line 3'. 
 
TOP-OF-PAGE. 
  WRITE: / 'Heading'. 
  ULINE.

This program produces the following output:

Heading
-------------------------------
line 1
line 2
line 3

Effect

Ensures that TOP-OF-PAGE is executed when generating secondary lists. ( AT LINE-SELECTION, AT USER-COMMAND).

Note

The event TOP-OF-PAGE DURING LINE-SELECTION. is executed when generating each secondary list. If you want to generate different page headers for different secondary lists, you must specify this in the program (e.g. by using status variables).

Related

END-OF-PAGE