delorie.com/archives/browse.cgi   search  
Mail Archives: opendos/2002/01/02/19:18:59

X-Authentication-Warning: delorie.com: mailnull set sender to opendos-bounces using -f
Message-ID: <01FD6EC775C6D4119CDF0090273F74A455A8DB@emwatent02.meters.com.au>
From: "da Silva, Joe" <Joe DOT daSilva AT emailmetering DOT com>
To: "'opendos AT delorie DOT com'" <opendos AT delorie DOT com>
Subject: RE: system calls
Date: Thu, 3 Jan 2002 11:24:15 +1100
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Reply-To: opendos AT delorie DOT com

The following is an extract from the TP/BP7 help ...

BTW, you can obtain TP5.5 for free, from the Borland web
site's museum. The "delay" routine doesn't time correctly on
modern PC's, but otherwise, this is a very handy little compiler.
You can also obtain the Frech version of TP7.01 for free,
including an updated "CRT" unit (with working "delay" routine),
from "www.borland.fr/download".

Joe.


 Exec (procedure)     (Dos unit)
 ===============================
Executes a specified program with a specified
command line.

 Declaration:
 procedure  Exec(Path, CmdLine: string);

 Target:
Real, Protected

 Remarks:
Errors are reported in DosError. When
compiling a program that uses Exec, reduce the
"maximum" heap size; otherwise, there won't be
enough memory (DosError = 8).

 See Also:
 DosError
 DosExitCode
 SwapVectors

 Sample Code:

  {DOSXCODE.PAS}

 { Example for DosExitCode and Exec }

 {$M $4000,0,0 }   { 16K stack, no heap }
 uses Dos;
 var
   ProgramName, CmdLine: string;
 begin
   Write('Program to Exec (full path): ');
   ReadLn(ProgramName);
   Write('Command line to pass to ',
         ProgramName, ': ');
   ReadLn(CmdLine);
   WriteLn('About to Exec...');
   SwapVectors;
   Exec(ProgramName, CmdLine);
   SwapVectors;
   WriteLn('...back from Exec');
   if DosError <> 0 then{ Error? }
     WriteLn('Dos error #', DosError)
   else
     WriteLn('Exec successful. ',
             'Child process exit code = ',
             DosExitCode);
 end.


> -----Original Message-----
> From:	DONALD PEDDER [SMTP:jims_son AT jedi DOT apana DOT org DOT au]
> Sent:	Wednesday, January 02, 2002 9:15 PM
> To:	opendos AT delorie DOT com
> Subject:	system calls
> 
>    Can someone here tell me how to call a DOS command from Pascal? I'm
> tearing my hair out after searching the web for a while (a "complete and
> comprehensive" guide to Pascal fails to mention system calls at all).
> 
>    My manual notes the existence of a DOS.FPD object, yet gives no clue
> how to use it. None of the example programs include it.
> 
>    I basically want to know how to do something like STRING:=DOS(find
> "searchstring" filename) - obviously I don't know what the syntax is to do
> this. :-)
> 
>    Thanks.
> 
> dp.
> 

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019