[AT] TOP [OF] PAGE
[(rep)]
|
| statement
|
END-TOPPAGE |
[AT] TOP [OF] PAGE [(rep)]
|
||
|
|
statement |
|
DO
statement
DOEND
|
||
This document covers the following topics:
For an explanation of the symbols used in the syntax diagram, see Syntax Symbols.
Related Statements: AT END OF PAGE |
CLOSE PRINTER | DEFINE PRINTER | DISPLAY | EJECT | FORMAT | NEWPAGE | PRINT | SKIP |
SUSPEND IDENTICAL SUPPRESS |
WRITE | WRITE TITLE | WRITE
TRAILER
Belongs to Function Group: Creation of Output Reports
The statement AT TOP OF PAGE is used to specify processing which is to be
performed when a new page is started.
See also the following sections in the Programming Guide:
A new page is started when the internal line counter exceeds the page size set with the
session parameter PS
(page size for Natural reports), or when a NEWPAGE statement is executed. Either of these events cause
a top-of-page condition to be true. An EJECT statement causes a new page to be started but does not
cause a top-of-page condition.
An AT TOP OF PAGE statement block is only executed when the object which
contains the statement is active at the time when the top-of-page condition occurs.
Any output created as a result of AT TOP OF PAGE processing will appear
following the title line with an intervening blank line.
This statement is non-procedural, that is, its execution depends on an event, not on where in a program it is located.
An AT TOP OF PAGE statement must not be placed within an inline
subroutine.
| Syntax Element | Description |
|---|---|
(rep)
|
Report Specification: The notation
(rep) may be used to
specify the identification of the report for which the AT TOP OF PAGE
statement is applicable.
A value in the range If For information on how to control the format of an output report created with Natural, see Report Format and Control in the Programming Guide. |
statement ... |
Statement(s) to be Executed at Start of Data Condition:
In structured mode, you must supply one or several suitable statements, depending on the situation. For an example of a statement, see Example below. |
END-TOPPAGE |
End of AT TOP OF PAGE Statement:
In structured mode, the Natural reserved word In reporting mode, use the |
** Example 'ATPEX1S': AT TOP OF PAGE (structured mode)
************************************************************************
DEFINE DATA LOCAL
1 EMPLOY-VIEW VIEW OF EMPLOYEES
2 NAME
2 FIRST-NAME
2 CITY
2 DEPT
END-DEFINE
*
FORMAT PS=15
LIMIT 15
READ EMPLOY-VIEW BY NAME STARTING FROM 'L'
DISPLAY 2X NAME 4X FIRST-NAME CITY DEPT
WRITE TITLE UNDERLINED 'EMPLOYEE REPORT'
WRITE TRAILER '-' (78)
/*
AT TOP OF PAGE
WRITE 'BEGINNING NAME:' NAME
END-TOPPAGE
/*
AT END OF PAGE
SKIP 1
WRITE 'ENDING NAME: ' NAME
END-ENDPAGE
END-READ
END
EMPLOYEE REPORT
-------------------------------------------------------------------------------
BEGINNING NAME: LAFON
NAME FIRST-NAME CITY DEPARTMENT
CODE
-------------------- -------------------- -------------------- ----------
LAFON CHRISTIANE PARIS VENT18
LANDMANN HARRY ESCHBORN MARK29
LANE JACQUELINE DERBY MGMT02
LANKATILLEKE LALITH FRANKFURT PROD22
LANNON BOB LINCOLN SALE20
LANNON LESLIE SEATTLE SALE30
LARSEN CARL FARUM SYSA01
LARSEN MOGENS VEMMELEV SYSA02
------------------------------------------------------------------------------
ENDING NAME: LARSEN
Equivalent reporting-mode example: ATPEX1R.