Dec 142017
Add ERROR LEVEL programming to QuickBasic Programs. | |||
---|---|---|---|
File Name | File Size | Zip Size | Zip Type |
BASEXIT.BAS | 545 | 298 | deflated |
CEXIT.OBJ | 202 | 182 | deflated |
READ.ME | 1525 | 742 | deflated |
TESTEXIT.BAT | 311 | 131 | deflated |
TPCREAD.ME | 199 | 165 | deflated |
Download File ERRLVLM.ZIP Here
Contents of the READ.ME file
Within this archive are three files (not counting this .DOC).
BASEXIT.BAS, CEXIT.OBJ and TESTEXIT.BAT.
BASEXIT.BAS is a sample basic program to show you how the errorlevels
are accessed.
CEXIT.OBJ is the compiled C source that contains the exit() function.
TESTEXIT.BAT is just a sample batch file so you may test a couple of
errorlevels to see that it really works. I cannot include a tutorial
on batch files, so if you don't understand errorlevels I suggest you
check your dos manual. If you use the errorlevels shown in the batch
file, you'll see that it works just fine. If you use something else
and you're not familiar with batch files, you may be confused by the
results.
Compile BASEXIT.BAS with BC.EXE like this...
bc basexit/o;
Then, link the resulting Basexit.obj with Cexit.obj something like
this...
Link basexit+cexit,,,,
OR...
Link basexit+cexit
and answer the prompts that LINK will provide.
Once you have BASEXIT.EXE, run TESTEXIT.BAT and answer the prompt with
an errorlevel of 25, 10 or 0 and you'll see the result. BASEXIT is
not a very exciting program, and TESTEXIT.BAT could have contained all
255 errorlevels, but I didn't see the point in that. You should be
able to get the idea from what I've included.
So far this seems to be working just fine for me with QuickBasic 4.0
on a Tandy 1000 and a XT clone. I'm sure this will only work on
QuickBasic programs compiled as STAND-ALONE, that is, not requiring
BRUN40.EXE to run.
enjoy.
December 14, 2017
Add comments