Ending a menu option or report statement set

end

End a menu option or report statement set


SYNTAX

end


Screen form programs

Terminates the execution of statements at the current menu level and returns control to the menu bar. The internal stack is cleared out, thus clearing any pending function or subroutine return statements.

In drop-down menus, the end statement ends processing and returns control to the menu.

If a program using the ring menu style contains no options, the end statement causes the program to terminate. Otherwise control returns to the menu. If the code for a ring menu option is not terminated with an end statement, then control falls through to the first statement of the next option. Unless such continuation is intended, care should be taken to include an end statement at the conclusion of each menu option. If the program contains initialisation statements, these must be terminated by an end statement, or program control falls through into the first menu option.

RELATED TOPICS

Menus


Report sections

In a !report section, the end command terminates the current set of statements and moves on to the next set as determined by the driving logic.

For example, if the end command is encountered during the processing of an !on ending section, no further !on ending statements are checked against this set of records. Processing continues with !on starting statements.

An end command clears all pending function or subroutine return statements in the current section.

The main block of statements must be terminated with an end command.


EXAMPLE

This report does all the work in the initialisation, so the only main statement is the compulsory end:

!report ReportOutput{

!temp Loop,,i2

!init {
     print
     setfont(sys.FontName, sys.FontSize, FONT_BOLD)
     print left(WinOutput->title)
     print
     print

     setfont(sys.FontName, sys.FontSize, FONT_NORMAL)

     for (Loop = 1; Loop <= tmp.NumOutputLines; Loop++) {
          print tmp.OutputLine[Loop]
     }
}
     end
}

RELATED TOPICS

Reports