[comp.sys.ibm.pc.programmer] listing of errorlevel codes wanted

sarra@zeppelin.rutgers.edu (William) (06/12/90)

Does anyone out there have a listing of the errorlevel codes and their
respective meanings?  If so, would you please send it to me, I have a
need for it's use in an assembly language program.

Thanks
-- 
			Bill Sarra
-- 

arpa: sarra@TOPAZ.RUTGERS.EDU
uucp: ...{ames, cbosgd, harvard, moss}!rutgers!topaz.rutgers.edu!sarra

silver@xrtll.uucp (Hi Ho Silver) (06/12/90)

In article <Jun.11.13.23.51.1990.1616@zeppelin.rutgers.edu> sarra@zeppelin.rutgers.edu (William) writes:
$Does anyone out there have a listing of the errorlevel codes and their
$respective meanings?  If so, would you please send it to me, I have a
$need for it's use in an assembly language program.

   There are no assigned meanings to errorlevel codes.  It's up to the
designer of each program to determine what results should be returned
using the return value you read with errorlevel, and to assign numbers to
these.

   So the rule of thumb is:  there's no rule of thumb.  Just Do It.  Of
course, some foresight is needed in planning them, but there are no
standards to adhere to.
-- 
   /Nikebo \ Nikebo says "Nikebo knows how to post.  Just do it."\silver@xrtll/
  /---------\_____________________________________________________\----------/
 /yunexus!xrtll!silver (L, not 1)\ Hi Ho Silver \   just silver for short   /
/Silver:  Ever Searching for SNTF \  Life sucks. \  someone buy me a BEER! /

lfk@E40-008-6.mit.edu (Lee F Kolakowski) (06/13/90)

On 11 Jun 90 23:44:51 GMT,
silver@xrtll.uucp (Hi Ho Silver) said:
> In article <Jun.11.13.23.51.1990.1616@zeppelin.rutgers.edu> sarra@zeppelin.rutgers.edu (William) writes:
> $Does anyone out there have a listing of the errorlevel codes and their
> $respective meanings?  If so, would you please send it to me, I have a
> $need for it's use in an assembly language program.

>    There are no assigned meanings to errorlevel codes.  It's up to the
> designer of each program to determine what results should be returned
> using the return value you read with errorlevel, and to assign numbers to
> these.

Sure there are standards (loose ones anyway!), and they come from
where all the good DOS programming ideas come from (Unix).

	Return Code	Meaning
	0		No Errors
	1		Something went wrong (often in parameters or data)
	2-infinity	Something else went wrong

These codes are used as valuse to exit() or return in C programs for
example.

For commands that test expressions like 1 == x usually return 0 if
assertion is false, 1 if assertion in true, and 2 if there is a syntax
error or something else. Documentation for the program should define
what the exit codes are. Better error messages also relieve one from
worrying about what these codes mean.


--

Frank Kolakowski 

======================================================================
|lfk@hx.lcs.mit.edu                     ||      Lee F. Kolakowski    |
|kolakowski@tropicana.mit.edu           ||	M.I.T.		     |
|lfk@mbio.med.upenn.edu		        ||	Dept of Chemistry    |
|AT&T:  1-617-253-1866                  ||	Room 18-506	     |
|#include <litigate.h>         		||	77 Massachusetts Ave.|
|                                    	||	Cambridge, MA 02139  |
|--------------------------------------------------------------------|
|		           One-Liner Here!                           |
======================================================================

stever@Octopus.COM (Steve Resnick ) (06/14/90)

In article <1990Jun13.031828.17936@athena.mit.edu> lfk@E40-008-6.mit.edu (Lee F Kolakowski) writes:
>
>On 11 Jun 90 23:44:51 GMT,
>silver@xrtll.uucp (Hi Ho Silver) said:
>> In article <Jun.11.13.23.51.1990.1616@zeppelin.rutgers.edu> sarra@zeppelin.rutgers.edu (William) writes:
>> $Does anyone out there have a listing of the errorlevel codes and their
>> $respective meanings?  If so, would you please send it to me, I have a
>> $need for it's use in an assembly language program.
>
>>    There are no assigned meanings to errorlevel codes.  It's up to the
>> designer of each program to determine what results should be returned
>> using the return value you read with errorlevel, and to assign numbers to
>> these.
>
>Sure there are standards (loose ones anyway!), and they come from
>where all the good DOS programming ideas come from (Unix).
>
>	Return Code	Meaning
>	0		No Errors
>	1		Something went wrong (often in parameters or data)
>	2-infinity	Something else went wrong
>
>These codes are used as valuse to exit() or return in C programs for
>example.
>
>For commands that test expressions like 1 == x usually return 0 if
>assertion is false, 1 if assertion in true, and 2 if there is a syntax
>error or something else. Documentation for the program should define
>what the exit codes are. Better error messages also relieve one from
>worrying about what these codes mean.
>
>
This is true under DOS but it gets interesting under OS/2's CMD.EXE and
maybe this will be true under a newer DOS as  well (who knows what IBM
will do next..) Under OS/2 you can do multiple commands and conditional
commandline processing which throws this scheme off a little:
Commands which terminate with an ERRORLEVEL != 0 are considered SUCCESSFULL
and commands which terminate with an ERRORLEVEL 0 are failed (I believe
this is true under UNIX as well.. ) This is more or less conventional to
C and as we all know the DOS batch/command line evaluation is similar
to C. For example: This command will run foo and bar if foo is 
successfull:

 C:\] FOO && BAR

 This will only run BAR if FOO fails:

 C:\] FOO || BAR

 If FOO's developer wrote FOO so that it returned an errorlevel 0
 then the logic would be reversed. 

 More mindless chatter..... :)

 Steve


-- 
--------------------------------------------------------------------------------
Steve Resnick -<stever@octopus.COM apple!octopus!stever sun!vsi1!octopus!stever>
408/241-1533 Process Scientific, Inc.
--------------------------------------------------------------------------------

rja@edison.cho.ge.com (rja) (06/15/90)

In article <1990Jun13.173331.15186@Octopus.COM> someone wrote:
[ stuff deleted here]
>will do next..) Under OS/2 you can do multiple commands and conditional
>commandline processing which throws this scheme off a little:
>Commands which terminate with an ERRORLEVEL != 0 are considered SUCCESSFULL
>and commands which terminate with an ERRORLEVEL 0 are failed (I believe
>this is true under UNIX as well.. ) This is more or less conventional to
>C and as we all know the DOS batch/command line evaluation is similar
>to C. 

Hogwash.  UNIX always uses exit(0) to indicate normal successful
termination and always has used 0 to mean that and used non-zero
to indicate some unusual termination.  C has traditionally followed
the UNIX convention (except on VMS, which has other problems).
-- 
______________________________________________________________________________
Internet  (vastly preferable) :         rja@edison.CHO.GE.COM  
UUCP (if you've got no choice):         ...uunet!virginia!edison!rja
------------------------------------------------------------------------------
Friday (frai-de) n.  The time when there are 2 days left in the workweek.
______________________________________________________________________________