delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/01/15/05:00:41

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: "Thomas Mueller" <tmueller AT bluegrass DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: return 1;
Date: 15 Jan 2002 09:50:45 GMT
Lines: 42
Message-ID: <a20u1k$t2h0v$11@ID-49635.news.dfncis.de>
References: <000c01c19c85$ba51f000$2de1a0c8 AT rjo DOT virtua DOT com DOT br>
NNTP-Posting-Host: dial2-86.bluegrass.net (208.147.34.86)
Mime-Version: 1.0
X-Trace: fu-berlin.de 1011088245 30491679 208.147.34.86 (16 [49635])
X-Mailer: NOS-BOX 2.05
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

from "Pedro Izecksohn" <izecksohn AT yahoo DOT com>:

>    Hi, What do happen when main return 1 ? Does the program passes this
  value to DOS's ERRORLEVEL ? Why in my code errorlevel isn't catching the 1
  value ? I'm attaching here the .cc and the .bat codes.


  ------=_NextPart_000_0009_01C19C74.E7E3F420
> Content-Type: application/octet-stream;
          name="terl.bat"
  Content-Transfer-Encoding: 7bit
  Content-Disposition: attachment;
          filename="terl.bat"

  erl
  if errorlevel 1 echo 1
  if errorlevel 0 echo 0

  ------=_NextPart_000_0009_01C19C74.E7E3F420
> Content-Type: application/octet-stream;
          name="ERL.CC"
  Content-Transfer-Encoding: 7bit
  Content-Disposition: attachment;
          filename="ERL.CC"

  int main () {
  return 1;
  }

I don't know what Antigen complained about; I don't see any hint of a virus.
The way I've quoted should not be MIME-recognizable.

If you get errorlevel of 1, both lines of terl.bat would execute, since
'errorlevel n' is true whenever errorlevel >= n.  Thus you should get

1
0

I presume ERL.CC, after compiling, would produce ERL.EXE, so there would be no
name conflict with TERL.BAT.  If you had both ERL.EXE and ERL.BAT, or TERL.EXE
and TERL.BAT, the EXE would run in preference to the BAT.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019