mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 16:51:35 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			22 lines
		
	
	
		
			345 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			345 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
| Program Example98;
 | |
| 
 | |
| { Program to demonstrate the exitproc function. }
 | |
| 
 | |
| Var
 | |
|   OldExitProc : Pointer;
 | |
| 
 | |
| Procedure MyExit;
 | |
| 
 | |
| begin
 | |
|   Writeln('My Exitproc was called. Exitcode = ',ExitCode);
 | |
|   { restore old exit procedure }
 | |
|   ExitProc:=OldExitProc;
 | |
| end;
 | |
| 
 | |
| begin
 | |
|   OldExitProc:=ExitProc;  
 | |
|   ExitProc:=@MyExit;
 | |
|   If ParamCount>0 Then
 | |
|     Halt(66);
 | |
| end.
 | 
