Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MS-DOS QBasic ver 1.0 command line

113 views
Skip to first unread message

Bakulesh Thakker

unread,
Nov 26, 1998, 3:00:00 AM11/26/98
to
Hi,

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)


M.C.J. Lentz

unread,
Nov 26, 1998, 3:00:00 AM11/26/98
to
QBasic is an INTERPRETER. When you load QBasic /RUN <name>,
first QBASIC.EXE will be loaded, and then your program. There's no standard
way of getting back to the OS without showing the code.
Also, returning a code (errorlevel) isn't possible with the standard QBasic,
because the program actually returning the errorlevel is QBASIC.EXE itself,
and NOT your .BAS-file.
You should get a compiler (QuickBasic (the real one)) to do such things
(sorry, it costs $$$$$)

Bakulesh Thakker heeft geschreven in bericht <365DA04D...@cwix.com>...

Guy Coutanche

unread,
Nov 26, 1998, 3:00:00 AM11/26/98
to
Bakulesh Thakker wrote:
>
> Hi,
>
> 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)

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.

Guy Coutanche

unread,
Nov 26, 1998, 3:00:00 AM11/26/98
to
To clarify a point in my previous post: including the SYSTEM keyword in
your Qbasic program will return you to the batch file that called the
program. I assume that is what you want.

Alex Warren

unread,
Nov 27, 1998, 3:00:00 AM11/27/98
to
On Thu, 26 Nov 1998 18:21:26 GMT, Bakulesh Thakker pondered:

>[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)

0 new messages