| NEWPAGE[(rep)] | 
 | EVEN[IF]TOP[OF] [PAGE] | 
 | |||
| 
 |  
                                        | 
 | LESS[THAN]  
                                      operand1 [LINES] [LEFT] | |||
| [ WITH]TITLEtitle-definition | ||||||
This document covers the following topics:
For explanations 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 |
                      PRINT |
                      SKIP |
                      SUSPEND IDENTICAL SUPPRESS
                      | WRITE |
                      WRITE TITLE |
                      WRITE TRAILER 
               
Belongs to Function Group: Creation of Output Reports
The NEWPAGE statement is used to cause an advance to a new
                       page. NEWPAGE also causes any AT END OF PAGE and
                       WRITE TRAILER statements
                       to be executed. A default title containing the date, time of day and page
                       number will appear on each new page unless a WRITE TITLE,
                       WRITE NOTITLE or
                       DISPLAY NOTITLE
                       statement is specified to define specific title processing.
               
Notes:
NEWPAGE statement is executed. It is performed only when a
                           subsequent statement which produces output is executed.
                  NEWPAGE statement is not used, page advance is
                           controlled automatically based on the Natural profile/session parameter
                           PS (Page Size
                           for Natural Reports).
                  Operand Definition Table:
| Operand | Possible Structure | Possible Formats | Referencing Permitted | Dynamic Definition | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| operand1 | C | S | N | P | I | yes | no | ||||||||||||
Syntax Element Description:
| Syntax Element | Description | 
|---|---|
| (rep) |  Report Specification:  The notation
                                            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). | 
| EVEN IF TOP OF
                                       PAGE | EVEN IF TOP OF PAGE Option: This option is used to cause a new page (with corresponding
                                         | 
| WHEN LESS
                                       THAN operand1 LINES LEFT | WHEN LESS THAN ... LINES LEFT Option: This option is used to cause a new page to be generated when there
                                        are less than  | 
| WITH TITLE
                                       title-definition | WITH TITLE Option: This option can be used to specify a title which is to be written to the new page generated. The  | 
** Example 'NWPEX1': NEWPAGE                                            
************************************************************************
DEFINE DATA LOCAL                                                       
1 EMPLOY-VIEW VIEW OF EMPLOYEES                                         
  2 CITY                                                                
  2 NAME                                                                
  2 SALARY    (1)                                                       
  2 CURR-CODE (1)                                                       
END-DEFINE                                                              
*                                                                       
LIMIT 15                                                                
READ EMPLOY-VIEW BY CITY FROM 'DENVER'                                  
  DISPLAY CITY (IS=ON) NAME SALARY (1) CURR-CODE (1)                    
  AT BREAK OF CITY                                                      
    SKIP 1                                                              
    /*                                                                  
    NEWPAGE WHEN LESS THAN 10 LINES LEFT                        
    WRITE '****************************************'                    
      /   'SUMMARY FOR ' OLD(CITY)                                      
      /   '****************************************'
      /   '****************************************'
      /   'SUM OF SALARIES:' SUM(SALARY(1))         
      /   'AVG OF SALARIES:' AVER(SALARY(1))        
      /   '****************************************'
    NEWPAGE                                
    /*                                              
  END-BREAK                                         
END-READ                                            
END 
                   Page      1                                                  05-01-18  10:01:45
                                                                               
        CITY                 NAME           ANNUAL   CURRENCY                  
                                            SALARY     CODE                    
-------------------- -------------------- ---------- --------                  
                                                                               
DENVER               TANIMOTO                  33000 USD                       
                     MEYER                     50000 USD                       
                                                                               
****************************************                                       
SUMMARY FOR  DENVER                                                            
****************************************                                       
****************************************                                       
SUM OF SALARIES:      83000                                                    
AVG OF SALARIES:      41500                                                    
**************************************** 
                   Page      2                                                  05-01-18  10:01:45
                                                                               
        CITY                 NAME           ANNUAL   CURRENCY                  
                                            SALARY     CODE                    
-------------------- -------------------- ---------- --------                  
                                                                               
DERBY                DEAKIN                     8750 UKL                       
                     GARFIELD                   6750 UKL                       
                     MUNN                       8800 UKL                       
                     MUNN                       5650 UKL                       
                     GREBBY                     9550 UKL                       
                     WHITT                      8650 UKL                       
                     PONSONBY                   5500 UKL                       
                     MAGUIRE                    4150 UKL                       
                     HEYWOOD                    3900 UKL                       
                     BRYDEN                     6750 UKL                       
                     SMITH                     39000 UKL                       
                     CONQUEST                  45000 UKL                       
                     ACHIESON                  11300 UKL                       
                                                                               
****************************************                                       
SUMMARY FOR  DERBY                                                             
**************************************** 
                   
-------------------- -------------------- ---------- --------                 
                                                                              
DERBY                DEAKIN                     8750 UKL                       
                     GARFIELD                   6750 UKL                      
                     MUNN                       8800 UKL                      
                     MUNN                       5650 UKL                      
                     GREBBY                     9550 UKL                      
                     WHITT                      8650 UKL                      
                     PONSONBY                   5500 UKL                      
                     MAGUIRE                    4150 UKL                      
                     HEYWOOD                    3900 UKL                      
                     BRYDEN                     6750 UKL                      
                     SMITH                     39000 UKL                      
                     CONQUEST                  45000 UKL                      
                     ACHIESON                  11300 UKL                      
                                                                              
****************************************                                      
SUMMARY FOR  DERBY                                                            
****************************************                                      
****************************************                                      
SUM OF SALARIES:     163750                                                   
AVG OF SALARIES:      12596                                                   
****************************************