10.13 MAIN Procedure

Syntax

MAIN statement

Statement can be any valid statement as described at the beginning of the section on statements.

Purpose

The special procedure MAIN indicates where execution is to begin. Every report program must have one MAIN procedure. This procedure can come after FILE, FIELD and VARIABLE declarations (before the PROCEDUREs); or it can come after the PROCEDUREs. When the end of statement is reached, the program will stop execution.

Examples

MAIN

FOR EACH master

DO details;

MAIN

BEGIN

AT TOP OF PAGE

DO headings;

SELECT FROM master

SORTED BY customer;

FOR EACH master

DO details;

END