I want to run MS-DOS QBasic Version 1.0 programs as part of MS-DOS Batch
program. Online help of my QBasic does give a command line for loading
and running a QBasic source program. But it is supposed show the source
program when END statement is executed. At that point the user screen
is displayed with message "Press a key to continue". And when I press
the key it shows the source program. The exact command line I am
talking about is: QBASIC /RUN sourcefile.
What I want is: neither the message "Press a key to continue" nor
should the source program be shown. Program executes and go back to BAT
program when done.
Also, I want to know whether QBasic permits me to send back any kind of
return code which can be used to control the execution of BAT program.
I can always use return-code file to pass back return code to another
QBasic program, and I can use EXISTS condition check for a file in BAT
program to control its flow. But how to have QBasic exit when program
is finished? Is there a version of QBasic or any other programming
system for MS-DOS which can be used to achive similar effect. I dont
mind buying some other inexpensive programming software.
-Bakulesh Thakker
(Reply to: Baku...@cwix.com)
Bakulesh Thakker heeft geschreven in bericht <365DA04D...@cwix.com>...
Replace END with SYSTEM in your Qbasic program. When you run it from a
batch file with "QBASIC /RUN sourcefile", upon completion it will return
you to the DOS prompt rather than leaving you in the QBASIC interpreter.
As for return codes, I think you would have to find or write a small
assembly language routine and use CALL ABSOLUTE to run it: I don't think
QBASIC supports exit codes in its built-in functions.
>[snip]
> The exact command line I am
> talking about is: QBASIC /RUN sourcefile.
>
> What I want is: neither the message "Press a key to continue" nor
> should the source program be shown. Program executes and go back to BAT
> program when done.
In that case, you'll want to use the SYSTEM command instead of END.
> Also, I want to know whether QBasic permits me to send back any kind of
> return code which can be used to control the execution of BAT program.
QBasic can't, but if you compiled your .BAS into a .EXE (using the commercial
QuickBasic, or another shareware compiler), you could probably return an
errorlevel code. Don't ask me how though - I think there might be something in
the Basix Fanzine, but I'm not sure.
--
Alex Warren
email: alexw...@writeme.com · ICQ: 4043750
http://come.to/axe - Axe Software: free/shareware for DOS & Windows
http://come.to/basixfanzine - Basix Fanzine: magazine for BASIC programmers
http://come.to/perdition - mods (IT format)
-----------------------------------------------------------------------------
(please reply to the newsgroup - if you must reply by email, change the anti-
spam rubbish to the email address above)