DOS ERRORLEVEL's

 BBS: Inland Empire Archive
Date: 04-05-93 (09:28)             Number: 393
From: TOM CARROLL                  Refer#: NONE
  To: TOM CASHMORE                  Recvd: NO  
Subj: DOS ERRORLEVEL's               Conf: (2) Quik_Bas
TC->  Hi i was wondering if anyone could tell me how to Set
TC-> DOS ERRORLEVEL's  i
TC->QB, ive looked in most of the majob .LIB's and hvnt run
TC->across one  that wi
TC->do it.... Any help would be greatly appreciated...

Try this:

=====8<============[ SNIP ]=============>8=======
DEFINT A-Z
DECLARE SUB ExitWithErrLvl ALIAS "_exit" (BYVAL ErrorLevel%)

' Do not execute this program before saving it because it will
' exit from the QB environment without saving your work.

CLS
LINE INPUT "Select any number from 0 to 9"; ErrNum$

ErrVal% = VAL(ErrNum$)

PRINT: PRINT "Exiting to DOS with errorlevel"; ErrVal%

ExitWithErrLvl ErrVal%

END
=====8<============[ SNIP ]=============>8=======

Hope that helps you!

Tom

 * OLX 2.2 * Eating veggies=Vegetarian, Jeffrey Dahlmer=Humanitarian?
--- FidoPCB v1.3 [ff035/a]
 * Origin: The Data Shop  (509)582-9493  HST/DS 16.8k (1:347/110)
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