mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 05:31:29 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			16 lines
		
	
	
		
			321 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			321 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
| Program Example5;
 | |
| uses Dos;
 | |
| 
 | |
| { Program to demonstrate the Exec and DosExitCode function. }
 | |
| 
 | |
| begin
 | |
| {$IFDEF Unix}
 | |
|   WriteLn('Executing /bin/ls -la');
 | |
|   Exec('/bin/ls','-la');
 | |
| {$ELSE}
 | |
|   WriteLn('Executing Dir');
 | |
|   Exec(GetEnv('COMSPEC'),'/C dir');
 | |
| {$ENDIF}
 | |
|   WriteLn('Program returned with ExitCode ',Lo(DosExitCode));
 | |
| end.
 | 
