🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc
Article #26113

Re: Setting DOS errorlevel in C (How?)

#26113
From: James Odom
Date: Tue, 29 Mar 1988 06:29
23 lines
1513 bytes
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.                      |
+------------------------------------------------------------------------+
Technical Details
Message-ID: <343@cpsc55.ATT.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!burl!codas!abcom!ncsc5!cpsc55!jio
References: <6985@iuvax.cs.indiana.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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