home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / pascal / 5231 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  1.2 KB

  1. Path: sparky!uunet!psgrain!hippo!catpe!p12.f120.n7102.z5.fidonet.org!Gordon.Farquharson
  2. From: Gordon.Farquharson@p12.f120.n7102.z5.fidonet.org (Gordon Farquharson)
  3. Sender: ufgate@catpe.alt.za (newsout1.26)
  4. Newsgroups: comp.lang.pascal
  5. Subject: can't get EXEC to work
  6. Message-ID: <2096.2AAB9E17@catpe.alt.za>
  7. Date: Sun, 06 Sep 92 12:24:00 GMT
  8. Organization: FidoNet node 5:7102/120.12 - Interlink BBS, CT
  9. Lines: 26
  10.  
  11.  
  12. On 05 Sep 92, Joel Daniel Just muttered to All:
  13.  
  14.  JDJ> I am having trouble getting the EXEC command to work in Turbo Pascal v5.0
  15.  JDJ> on the PC.  Here is an example program:
  16.  
  17.  JDJ> PROGRAM TEST;
  18.  JDJ> USES DOS;
  19.  JDJ> BEGIN
  20.  JDJ>    EXEC('dir','');
  21.  JDJ>    WRITELN('DONE')
  22.  JDJ> END.
  23.  
  24. For DOS commands to be run with the EXEC command you need to use this structure... EXEC('\command.com','/c dir'); ie you have to run command.com with the paramter '/c' and 'dir' for this to work.
  25.  
  26. If on the other habd you wish to run a program the format is as follows... EXEC('program.exe','any paramters your want');
  27.  
  28. I hope this helps.
  29.  
  30. Cheers,
  31.        Gordon
  32.  
  33. --  
  34. INTERNET: Gordon.Farquharson@p12.f120.n7102.z5.fidonet.org
  35. via:  THE CATALYST BBS in Port Elizabeth, South Africa.
  36.        (catpe.alt.za)   +27-41-34-1122 HST or +27-41-34-2859, V32bis & HST.
  37.