home *** CD-ROM | disk | FTP | other *** search
- program extest;
- uses
- crt,
- dos,
- exec;
-
- var
- i: integer;
- fn: string [255];
- par: string [130];
-
- begin
- putenv ('XYZ=This is a test string for the spawned process');
-
- repeat
- writeln; write ('EXEC filename,params ("." to exit): ');
- readln (fn);
- writeln;
- if fn = '.'
- then exit;
- i := pos (',', fn);
- if i > 0
- then begin
- par := copy (fn, i + 1, length (fn) - i);
- fn [0] := chr (i - 1);
- end
- else par := '';
-
- i := do_exec (fn, par, 1, $ffff, false);
-
- writeln ('DO_EXEC returned ', i);
- until false;
- end.
-