home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / pascal / 6793 < prev    next >
Encoding:
Internet Message Format  |  1992-11-21  |  1.2 KB

  1. Path: sparky!uunet!noc.near.net!nic.umass.edu!risky.ecs.umass.edu!umaecs!legarret
  2. From: legarret@ecs.umass.edu
  3. Newsgroups: comp.lang.pascal
  4. Subject: Errorlevel codes from DOS program.
  5. Message-ID: <19101.2b0d224e@ecs.umass.edu>
  6. Date: 20 Nov 92 17:37:18 GMT
  7. Lines: 28
  8.  
  9. Hello everyone;
  10.     I'm writng a program that executes a secondary program through
  11.         the EXEC command. I need my program to be able to recognize the
  12.     errorlevel codes sent by the secondary external program when 
  13.     its finished. (eg., 1 = error, 0 = success).
  14.  
  15. Heres what I have so far:
  16.  
  17.     Exec (program#2);
  18.     If IOResult(from_program#2) <> 0 Then
  19.        Procedure#1
  20.     Else
  21.        Procedure#2;
  22.  
  23. But, to my knowledge, IOResult will only report errorlevel codes based on 
  24. 'program#2' execution. (0 = successful exec., 1 = error during execution).
  25.  
  26. Is there any way I can acomplish this?
  27.  
  28. BTW, I'm using TP 5.0 but will be upgrading to 6.0 next week...
  29.  
  30. Thanks for any help.
  31.  
  32.                 ...Carlos
  33. =-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=
  34.  Carlos Legarreta            | E-Mail: legarret@ecs.umass.edu
  35.  Univ. of Massachusetts / Amherst    |
  36. =-=-=-==-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=
  37.