Path: utzoo!utgpu!water!watmath!clyde!burl!codas!abcom!ncsc5!cpsc55!jio From: jio@cpsc55.ATT.COM (James Odom) Newsgroups: comp.sys.ibm.pc Subject: Re: Setting DOS errorlevel in C (How?) Message-ID: <343@cpsc55.ATT.COM> Date: 29 Mar 88 06:29:13 GMT References: <6985@iuvax.cs.indiana.edu> Organization: AT&T CPSC, Denver, CO. Lines: 23 From article <6985@iuvax.cs.indiana.edu>, by bobmon@iuvax.cs.indiana.edu (RAMontante): > I observe that in Turbo C (v1.5), under MSDOS 3.1, I can set the errorlevel > either with > exit( errorlevel ); > or with > return( errorlevel ); > > Just out of curiousity, are there any [good] stylistic, philosophical, or > other reasons for choosing one form over the other? (Such as compatibility?) Normally, "exit" is used to stop the program and exit to the operating system. "return" is used to report status back to a calling function. If "return" is used in the main function, it is treated the same as "exit" +------------------------------------------------------------------------+ |James I. Odom | |AT&T-IS CPSC Denver, Co Voice: (303) 889-0211 | |ATTMAIL: JODOM Compuserve: 70070,137 uucp: ihnp4!cpsc55!jio | |------------------------------------------------------------------------| |Disclaimer: Any opinions expressed are my own etc. | +------------------------------------------------------------------------+