Re: Reading DOS ErrorLeve

 BBS: Inland Empire Archive
Date: 10-23-93 (11:31)             Number: 209
From: BRAD L PASSINO               Refer#: NONE
  To: RAYMOND PAQUIN                Recvd: NO  
Subj: Re: Reading DOS ErrorLeve      Conf: (2) Quik_Bas
 >Somebody posted a bit of code here about a month ago to do just that.
 >I didn't capture it, because I use PDS 7.1, which is a superset of
 >QuickBASIC.  It has an 'END n' command where n is an integer that sets the
 >ERRORLEVEL upon exit.

Well, I have since learned that Qbasic does not read dos
error levels. However, I am familiar with ASM and know
that DOS int 21h and command 4Dh will get the child
processes error level. Rather than write an ASM module to
that I used Quick Basics  CALL INTERRUPT.
For those interested I will post the code.

MAINLINE

-------- ' $INCLUDE: 'QB.BI' DECLARE SUB getErrorLevel () COMMON SHARED %el 'SHELL to child process CALL getErrrorLevel ' Do something with error level END ------------------------------------SUBS--------------------------------- SUB getErrorLevel DIM inRegs AS RegType, outRegs AS RegType inRegs.ax = &H4d00 CALL INTERRUPT(&H21, inRegs, outRegs) el% = outRegs.ax MOD 256 'get the value of AL. ERROR LEVEL is here END SUB __________________________________END____________________________________ IN order for this to work you have to link in the QB.LIB, or in the environment you have to load (/L) QB.QLB. Not so bad huh? Brad $$ --- SLMAIL v3.1 (#2246) * Origin: The Phantoms BBS; Scranton, PA; v.32bis; CM; 1:268/344; (717) 344-5661 (1:268/344)
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