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 Constants
  System Unit Example Contents Index                      Back
 
  CONST
      ExitCode  : Integer = 0;      { program exit code }
      ErrorAddr : POINTER = NIL;    { pointer to run-time error }
      ExitProc  : POINTER = NIL;    { pointer to exit procedure }
 
  Unit:     System (used automatically)
 
  Context:  Halt
 
  Description
 
    ExitCode contains the value passed to the Halt procedure when Halt
    is used to end a program. If a program terminates due to a run-time
    error, ExitCode contains the run-time error code.
 
    ErrorAddr contains the address of the statement that causes a
    program to end with a run-time error. If no error, ErrorAddr is set
    to NIL.
 
    ExitProc holds the address of an exit procedure that has been
    custom designed. An exit procedure is called when a program ends,
    whether normally terminated or terminated by Halt or a run-time
    error.
 
    If the exit procedure is to be a part of a chain of exit routines,
    the old value of ExitProc must be saved before the address of the
    new procedure is installed. ExitProc must be restored once in the
    new exit procedure.