Declare statements to be executed at the end of a report

!final

Declare statements to be executed at the end of a report


SYNTAX

!final {
 statements
}

Declare a block of statements to be executed, once only, at the end of the report. The report ends when any of the following occurs:

1

Processing of the driving file is completed.

2

An end report command is encountered.

3

The exit command is executed. In this case, !final statements are not executed (unless the declaration !compat exit =2 is included. This declaration is provided for backward compatibility only and should not be included in new programs.)


NOTES

  • If the !final section consists of a single statement the braces may be omitted and the statement placed on the same line as the !final command.

  • Only one !final section may be defined.

  • If the declaration !compat exit =2 is included in the program, the exit command does execute !final statements before the program terminates. This declaration is provided for backward compatibility only and should not be included in new programs.


EXAMPLE

!final {
     print
     print sys.RecordCount: :"s"; " records printed"
     print
     print "END OF REPORT"
}

RELATED TOPICS

Reports

!footnote

!heading

!init

!title