next up previous contents index
Next: DosVersion Up: Functions and Procedures Previous: DiskSize

DosExitCode

   

Declaration:

Function DosExitCode : Word;

Description:

DosExitCode contains (in the low byte) the exit-code of a program executed with the Exec call.

Errors:

None.

See also:

Exec

Example
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.



Michael Van Canneyt
Thu Sep 10 13:59:33 CEST 1998