fpc/docs/dosex/ex5.pp
1998-03-25 11:26:49 +00:00

16 lines
318 B
ObjectPascal

Program Example5;
uses Dos;
{ Program to demonstrate the Exec and DosExitCode function. }
begin
{$IFDEF LINUX}
WriteLn('Executing /bin/ls -la');
Exec('/bin/ls','-la');
{$ELSE}
WriteLn('Executing Dir');
Exec(GetEnv('COMSPEC'),'/C dir');
{$ENDIF}
WriteLn('Program returned with ExitCode ',DosExitCode);
end.