BBS: Inland Empire Archive
Date: 06-28-92 (14:50)             Number: 1622
From: LOGAN ASHBY                  Refer#: NONE
  To: KEVIN NEWELL                  Recvd: NO  
Subj: Errorlevels                    Conf: (2) Quik_Bas
25 Jun 92, Kevin Newell writes to All:

 KN> Would like to know if there is a way to EXIT a QB program with a
 KN> errorlevel for Batch file processing, if so how to go about doing
 KN> it... Thakx in advance!

    Brent Ashley posted this little jewel some time ago.

At the beginning of your code, insert this line...

  DECLARE SUB ExitWithErrLvl ALIAS "_exit" (BYVAL ErrorLevel%)

... and put this line right before you exit.

  ExitWithErrLvl 5

No guarantees, but a lot of people use it.  I don't think
it will work from within the environment.


--- GoldED 2.40
 * Origin: Big Nerd's Nest  (1:398/1.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