home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!uunet.ca!canrem!dosgate!dosgate![jonathan.forbes@canrem.com]
- From: "jonathan forbes" <jonathan.forbes@canrem.com>
- Subject: return codes
- Message-ID: <1992Dec20.4249.20588@dosgate>
- Reply-To: "jonathan forbes" <jonathan.forbes@canrem.com>
- Organization: Canada Remote Systems
- Distribution: comp
- Date: 20 Dec 92 23:11:20 EST
- Lines: 28
-
- I need to run a program as part of the same process, but ensure that its
- return code is zero.
-
- i.e., if I had an AmigaDOS script, which did:
-
- prog1
- prog2
- prog3
-
- and prog2 exited with a nasty return code, the script would terminate.
-
- Using FailAt doesn't work if the return code is too "high". Besides,
- the script would still be able to fail at the "FailAt" value.
-
- I would like to know how to run a program (using the same process) which
- will absorb the return code and replace it by zero.
-
- i.e. something vaguely similar to:
-
- main(...)
- ExecuteProgram(...)
- exit(0);
-
- Except that, obviously, ExecuteProgram has to use the same process, same
- i/o handles, etc.
- --
- Canada Remote Systems - Toronto, Ontario
- World's Largest PCBOARD System - 416-629-7000/629-7044
-