delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/10/03:24:14

From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: writing of an exit value to screen or file
Date: Fri, 10 Mar 2000 08:17:06 +0200
Organization: NetVision Israel
Lines: 21
Message-ID: <38C89362.EEFC5BE3@is.elta.co.il>
References: <8a8nci$r6n$1 AT news DOT germany DOT net>
NNTP-Posting-Host: ras1-p7.rvt.netvision.net.il
Mime-Version: 1.0
X-Trace: news.netvision.net.il 952669103 14769 62.0.172.9 (10 Mar 2000 06:18:23 GMT)
X-Complaints-To: abuse AT netvision DOT net DOT il
NNTP-Posting-Date: 10 Mar 2000 06:18:23 GMT
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en,ru,hebrew
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Martin Czamai wrote:
> 
> Is it possible to display the exit value of a program on the screen BEFORE
> it terminates

No, I don't think so.  Not unless you replace one of the library functions
involved in the exit process with your customized version.

> or is it just possible to evaluate the value at the DOS
> prompt?

Yes.  Use the built-in variable ERRORLEVEL.

> Currently I've registered an exit-handler by using atexit(..) and I want to
> display the value in this handler.

I don't think this is possible.  atexit handlers aren't passed enough info to
get at the exit status.

Perhaps you should explain what are you trying to accomplish.  Maybe there
are better ways to do that.

- Raw text -


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