Statement EXIT PROCEDURE Foundation
Declares a procedure which is executed at the end of a program.
EXIT PROCEDURE <ProcedureName>
[LOCAL <VarName_L> [ [:= <Expression>],...]]
[MEMVAR <VarName_M,...>]
[FIELD <FieldName,...> [IN <AliasName>]]
<SourceCode>
[RETURN]
The EXIT PROCEDURE statement is used to declare closing procedures that are automatically called before an Xbase++ program has ended and before control returns to the operating system. They are only called when a program terminates by the QUIT command or by the RETURN statement from the main procedure or function of a program. If a program terminates due to a runtime error or after pressing Alt+C, no EXIT PROCEDUREs are executed.
EXIT PROCEDURE routines have no parameters and cannot be explicitly called during program execution. They are only known to the system, which executes a list of EXIT PROCEDURE routines. The order in which the EXIT PROCEDURE routines are called is not predictable. After completion of the last exit procedure, control returns to the operating system. If a runtime error occurs within an exit procedure, the program immediately terminates.
With the ANNOUNCE statement, a symbol can be declared. In order to link existing EXIT PROCEDURE routines to a new application, the corresponding program module must be explicitly requested with REQUEST.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.