I think this will work (modified from Tp7-Help File):<br>
<br>
Errors are reported in DosError. When<br>
compiling a program that uses Exec, reduce the<br>
"maximum" heap size; otherwise, there won't be<br>
enough memory (DosError = 8).<br>
<br>
<br>
{$M $4000,0,0 } { 16K stack, no heap }<br>
uses Dos;<br>
<br>
begin<br>
SwapVectors;<br>
{Exec(drive_path_file,parameter);}<br>
Exec('turbo.exe','');<br>
{if you want to use dos-commands (like"dir *.pas") use the}<br>
{exec command like this: Exec('c:\command.com','/c dir');}<br>
SwapVectors;<br>
case doserror of<br>
0:writeln('Done.');<br>
2:writeln('File not found!');<br>
3:writeln('Path not found!');<br>
5:writeln('Access denied!');<br>
6:writeln('Invalid handle!');<br>
8:writeln('Not enough memory!');<br>
10:writeln('Invalid environment!');<br>
11:writeln('Invalid format!');<br>
18:writeln('No more files!');<br>
else writeln('Unknown error!');<br>
end;<br>
end.<br>
<br>
<br>