Re: Errorlevels

 BBS: Inland Empire Archive
Date: 05-23-92 (21:31)             Number: 150
From: GARY POOL                    Refer#: NONE
  To: KEVIN NEWELL                  Recvd: NO  
Subj: Re: Errorlevels                Conf: (2) Quik_Bas
KN>Sorry, but it is not what I need, I need to exit to DOS with an errorlevel
KN>for batch processing.  Thanks for the input!

Kevin, If I remember correctly from the discussions, there is no way to
set the errorlevel from QuickBasic.  I was following the topic pretty
closely, because I too thought it would be useful.  About the only
solution I have been able to come up with is setting up a variable in
the DOS Environment using ENVIRON.  The syntax is ENVIRON "MyError=1".

In your Batch file, you can test "if %MyError%==1 goto label".

Now for the bad news.  Every time I tried to test this, I got an Out of
Memory Error.  Don't knoe how reliable this would be.  gp
  SLMR 2.1  Backup not found: (A)bort (R)etry (P)anic

--- WM v2.00/91-0231
 * Origin: The Modem Zone BBS (314) 893-5106 (1:289/2)
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