home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / amiga / programm / 17639 < prev    next >
Encoding:
Text File  |  1992-12-21  |  1.1 KB  |  40 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!uunet.ca!canrem!dosgate!dosgate![jonathan.forbes@canrem.com]
  3. From: "jonathan forbes" <jonathan.forbes@canrem.com>
  4. Subject: return codes
  5. Message-ID: <1992Dec20.4249.20588@dosgate>
  6. Reply-To: "jonathan forbes" <jonathan.forbes@canrem.com>
  7. Organization: Canada Remote Systems
  8. Distribution: comp
  9. Date: 20 Dec 92 23:11:20 EST
  10. Lines: 28
  11.  
  12. I need to run a program as part of the same process, but ensure that its
  13. return code is zero.
  14.  
  15. i.e., if I had an AmigaDOS script, which did:
  16.  
  17. prog1
  18. prog2
  19. prog3
  20.  
  21. and prog2 exited with a nasty return code, the script would terminate.
  22.  
  23. Using FailAt doesn't work if the return code is too "high".  Besides,
  24. the script would still be able to fail at the "FailAt" value.
  25.  
  26. I would like to know how to run a program (using the same process) which
  27. will absorb the return code and replace it by zero.
  28.  
  29. i.e. something vaguely similar to:
  30.  
  31. main(...)
  32.    ExecuteProgram(...)
  33.    exit(0);
  34.  
  35. Except that, obviously, ExecuteProgram has to use the same process, same
  36. i/o handles, etc.
  37. --
  38. Canada Remote Systems  - Toronto, Ontario
  39. World's Largest PCBOARD System - 416-629-7000/629-7044
  40.