Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
CBL_EXIT_PROC Details (↑ Library of Routines)
◄Key► ◄Summary► ◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
Description:
The routine sets RETURN-CODE to zero for success, non zero for failure.
The procedure will be executed whether the application finishes
normally (with a STOP RUN) or abnormally (with a Ctrl+Break, RTS
error, etc). You can install several closedown procedures for an
application by repeated calls of this routine.
A closedown procedure can be written in any language. If it is in
COBOL, install-address must be the address of an entry point. You can
obtain this address using the statement:
SET install-address TO ENTRY entry-name
A closedown procedure in COBOL can include any legal COBOL, including
CALL statements. The closedown procedure will terminate when the main
program in the procedure does an EXIT PROGRAM/GOBACK or when a STOP RUN
statement is executed.
A closedown procedure in any other language must preserve the i86
machine code BP register and direction flag, and terminate with a far
return (RETF) instruction; that is, it must be a far procedure.
Parameters on Entry:
install-flag Indicates the operation to be performed:
0 = install closedown procedure
1 = de-install closedown procedure
install-address Address of closedown procedure.
Parameters on Exit:
None
-♦-