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
| AT TOP OF
PAGE
| CLOSE
PRINTER
| DEFINE PRINTER
|
DISPLAY
|
EJECT
|
FORMAT
|
NEWPAGE
|
PRINT
|
SKIP
|
SUSPEND IDENTICAL SUPPRESS
| WRITE
|
WRITE TRAILER
Belongs to Function Group: Creation of Output Reports
The WRITE TITLE
statement is used to override the default page title with a
page title of your own. It is executed whenever a new page is initiated.
See also the following sections in the Programming Guide:
This statement is non-procedural, that is, its execution depends on an event, not on where in a program it is located.
If a report is produced by statements in different objects, the WRITE
TITLE
statement is only executed if it is contained in the same object as the
statement that causes a new page to be initiated.
WRITE TITLE
may be specified only once per
report.
WRITE TITLE
cannot be specified within a special
condition statement block.
WRITE TITLE
cannot be specified within a
subroutine.
Operand Definition Table:
Operand | Possible Structure | Possible Formats | Referencing Permitted | Dynamic Definition | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
operand1
|
S | A | G | N | A | U | N | P | I | F | B | D | T | L | G | O | yes | no | ||
operand2
|
C | S | N | P | I | B | yes | no |
Syntax Element Description:
Syntax Element | Description |
---|---|
(rep) |
Report Specification:
If multiple reports are to be produced, the
notation
As report identification, 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). |
Page Title Justification and/or Underlining:
By default, page titles are centered and not underlined.
If Natural first applies all spacing or tab specifications
and creates the line before centering the whole line. For example, a notation
of |
|
statement-parameters
|
Parameter Definition at Statement Level:
One or more parameters, enclosed within parentheses, may
be specified at statement level, that is, immediately after the If more than one parameter is specified, one or more blanks must be present between each entry. An entry may not be split between two statement lines. Note: For information on which parameters may be used, see
List of
Parameters (in the |
Format Notation and Spacing Elements:
See Format Notation and Spacing Elements (below). |
|
Text/Attribute Assignment:
See Text/Attribute Assignments (below). |
|
operand1
|
Field to Be Displayed in Title:
|
parameters
|
Parameter Definition at Element (Field)
Level:
One or more parameters, enclosed within parentheses, may
be specified at element (field) level, that is, immediately after
If more than one parameter is specified, one or more blanks must be present between each entry. An entry may not be split between two statement lines. For information on which parameters may be used, see
List of
Parameters (in the |
SKIP operand2
LINES
|
Lines to Be Skipped:
Note: |
Syntax Element | Description |
---|---|
nX |
Column Spacing:
This notation inserts
|
nT |
Tab Setting:
The |
x/y
|
x/y Positioning:
Causes the next element to be placed
|
T*field-name |
Field-Related Positioning:
The |
P*field-name |
Field- and Line-Related Positioning:
The |
/ |
Line Advance - Slash Notation:
When placed between fields or text elements, a slash (/) causes positioning to the beginning of the next print line. |
Syntax Element | Description |
---|---|
'text'
|
Text Assignment:
The character string enclosed by single quotes is displayed. |
'c'(n) |
Character Repetition:
The character enclosed by single quotes is displayed n times immediately before the field value. |
attributes
|
Field Representation and Color Attributes:
It is possible to assign various attributes for text/field display. These attributes and the syntax that may be used are described in the section Output Attributes below. Examples: WRITE TITLE 'TEXT' (BGR) WRITE TITLE 'TEXT' (B) WRITE TITLE 'TEXT' (BBLC) |
attributes indicates the output attributes to be used for text display. Attributes can be:
ad-value |
Where:
ad-value
,
cd-value
and
pm-value
denote the possible values of
the corresponding session parameters AD
, CD
and
PM
described
in the relevant sections of the Parameter Reference
documentation.
The compiler actually accepts more than one attribute value for an output
field. For example, you can specify: AD=BDI
. In such a case,
however, only the last value applies. In the given example, only the value
I
becomes effective and the output field is displayed
intensified.
For an alphanumeric/Unicode constant (Natural data format A or U), you can
specify ad-value
and/or
cd-value
without preceding
CD=
or AD=
, respectively. The single value entered is
then checked against all possible CD
values first. For
example: a value of IRE
will be interpreted as intensified/red but
not as intensified/right-justified/mandatory. You cannot combine a single
cd-value
or
ad-value
with a value preceded by
CD=
or AD=
.
** Example 'WTIEX1': WRITE (with TITLE option) ************************************************************************ DEFINE DATA LOCAL 1 EMPL-VIEW VIEW OF EMPLOYEES 2 NAME 2 FIRST-NAME 2 CITY 2 JOB-TITLE END-DEFINE * * FORMAT LS=70 * WRITE TITLE LEFT JUSTIFIED UNDERLINED *TIME 3X 'PEOPLE LIVING IN NEW YORK CITY' 11X 'PAGE:' *PAGE-NUMBER SKIP 1 * FIND EMPL-VIEW WITH CITY = 'NEW YORK' DISPLAY NAME FIRST-NAME 3X JOB-TITLE END-FIND END
09:33:16.5 PEOPLE LIVING IN NEW YORK CITY PAGE: 1 --------------------------------------------------------------------- NAME FIRST-NAME CURRENT POSITION -------------------- -------------------- ------------------------- RUBIN SYLVIA SECRETARY WALLACE MARY ANALYST