Get Dos errorlevel

 BBS: Inland Empire Archive
Date: 02-26-94 (07:50)             Number: 277
From: STEVE MCCRYSTAL              Refer#: NONE
  To: GARY GLUECKERT                Recvd: NO  
Subj: Get Dos errorlevel             Conf: (2) Quik_Bas
In a msg of <24 Feb 94>, Gary Glueckert writes to Harry F. harrison:

 GG> The DOS errorlevel is stored in an interrupt in memory and is not
 GG> reset by another copy of


 GG>  Remember also that not all of is transient.


 GG> FUNCTION ErrorLevel% ()

 GG>    'Purpose : To check the error level of a program returning
 GG> from shell
 GG>    'Input   : none (well, helps if you did shell a program first)
 GG>    'Return  : The errorlevel returned from the last shelled
 GG> program

 GG>    DEF SEG = 0
 GG>    ErrorLevel% = PEEK(&H4FE)

Do you have any more info on this? Is the address guaranteed? Is it
stable across different DOS versions? Can you suggest a documenting reference?

Please don't misunderstand... I'm not disagreeing with you.
I would like to dig into this a bit further because the
concept has LOTS of potential uses and is (to my knowledge)
largely unexplored, as is the DOS
Interapplication Communication area which I use frequently.


--- GoldED 2.42.G0214+/#1057US3
 * Origin: -[Steve's Place]-  New Berlin, WI (FidoNet 1:3641/1.202)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET