The procedure body is executed (see on Procedure Body Execution ) and a result returned indicating what happened.
Possible results (return values) are:
| SUCCESS | 0 | Successful completion |
| ESCAPE | −1 | The procedure was terminated because the user pressed <Escape> or the procedure was a batch procedure and all possible processing was completed |
| DELETE | −3 | The procedure was terminated because the user chose to delete the record being processed |
| TERMINATED | −12 | Premature termination – the procedure terminated because the record selected for processing did not satisfy all the necessary conditions or because of a non recoverable error or the procedure was of type Run another program and the command line could not be executed |
| OPTION | >0 | If the procedure body is a menu then OPTION is the selected option number. If the procedure body is not a menu then the return value is forced to 0. If Qeat_func_keys is TRUE then the original return value is ignored. If Qeat_func_keys is FALSE the return value is stored in an internal variable that works like force_option. The next menu procedure will short cut and select the saved option. If force_option is set it will over-ride the saved option value, which is then discarded. |
If the procedure returned ESCAPE, procedure execution is terminated, unless the procedure has a window and the ESCAPE was generated after a selection had been made from the window.
The subsidiary procedures of the procedure are executed according to the value returned by the procedure body:
| SUCCESS | Execute the subsidiary procedures in turn |
| OPTION | Execute corresponding subsidiary procedure |
| ESCAPE | Do not execute any subsidiary procedures |
| Otherwise | Execute any subsidiary procedures if Always execute subsidiaries is specified |
If the procedure body specifies that changes are to be secured (see Securing changes), the database is checkpointed unless abandon_changes (or decommit) is TRUE (in which case decommit() is called). Note that this operation takes place after all subsidiary procedures have been executed. A checkpoint() or decommit() is also done in the same way if the procedure was a Save/Exit menu.
firstitem is set FALSE.