BBS: Inland Empire Archive Date: 09-12-92 (11:57) Number: 258 From: TONY ELLIOTT Refer#: NONE To: LAWRENCE GORDON Recvd: NO Subj: Error Levels Conf: (2) Quik_Bas
Lawrence, There are a couple of ways to do it. BASIC has an internal routine called "_EXIT". It's designed to do all of the internal BASIC clean- up, and terminate your app with an errorlevel. Here's how it works: DECLARE SUB ExitLvl ALIAS "_EXIT" (BYVAL ErrorLevel%) 'Set errorlevel 5 ExitLvl 5 But, be careful! Using this routine within the QB environment will terminate the IDE and return you to DOS! Another approach is to use an assembly routine I wrote some time ago. It does the job nicely, and is perfectly safe to use with in the IDE. Hmm. I can't seem to locate the code right now, but I'll dig it up if you find that you need it. Tony ___ X 1st 1.01b #1030s X Okay, I pulled the pin. What now? Where are you going? --- Maximus 2.01wb * Origin: Oakland BBS (1:133/706)
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