ex98.pp 345 B

123456789101112131415161718192021
  1. Program Example98;
  2. { Program to demonstrate the exitproc function. }
  3. Var
  4. OldExitProc : Pointer;
  5. Procedure MyExit;
  6. begin
  7. Writeln('My Exitproc was called. Exitcode = ',ExitCode);
  8. { restore old exit procedure }
  9. ExitProc:=OldExitProc;
  10. end;
  11. begin
  12. OldExitProc:=ExitProc;
  13. ExitProc:=@MyExit;
  14. If ParamCount>0 Then
  15. Halt(66);
  16. end.