Re: Error Level

 BBS: Inland Empire Archive
Date: 12-05-92 (07:09)             Number: 351
From: DICK DENNISON                Refer#: NONE
  To: PETER BARNEY                  Recvd: NO  
Subj: Re: Error Level                Conf: (2) Quik_Bas
PB> Is there any easy routine that you could send through the echo?  I wou
PB> at QBNews, but I can't seem to find it anywhere other than calling lon
PB> distance for it.

'From Brent Ashley
'Hold onto your hats, folks, here's a HOT tip!
'I just found out by accident that QB.QLB and QB.LIB, the default
'libraries that come with QuickBASIC support exit with DOS
'ERRORLEVEL!!!

'Here's how you do it:

'start up QB with QB/L QB to use the library.

'declare the SUB as follows:
DECLARE SUB ExitWithErrLvl ALIAS "_exit" (BYVAL ErrorLevel%)
Vare% = 3
'and then use it like:
ExitWithErrLvl Vare%

'Be careful to save your program before you run it in the
'environment, because it actually exits to DOS!  I suspect it's a
'good idea to CLOSE all files before using this call, too.

'I can't believe it's that easy, but it is!!  I've seen gobs of
'messages on the nets about this, and they all had to jump through
'hoops to end up with this result.  What a great find!!



--- VP [DOS] V4.09e
 * Origin: The MailMan  (914)374-3903 NY Quick Share Pt #7 *HST (1:272/34)
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