qp.hlp (Table of Contents; Topic list)
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.
Exit Procedure
  Summary Details Example                                   Back
 
  Description
 
    The Exit procedure ends the execution of the current procedure,
    function, or program.
 
    If Exit is in the main program, it ends the program.
 
    If Exit is in a procedure or function, the procedure or function
    returns to the part of the program that called it. Execution then
    continues at the first statement following the call to the
    procedure or function.
 
    If Exit is called in the main program, it ends the program and
    transfers control to the program executing it or to DOS. The
    effect is the same as calling the Halt procedure with a value of 0.
 
    To run a custom exit procedure as part of the exit sequence,
    install the address of the procedure in ExitProc, a pointer defined
    in the System unit. Use a custom exit procedure to clean up open
    files, restore vectors, or trap run-time errors.