Passing values to QBasic programs

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!
Post Reply
WmFS
Newbie
Posts: 1
Joined: Thu Oct 21, 2004 7:03 am
Location: England

Passing values to QBasic programs

Post by WmFS »

Is it possible to pass values accessable to QBasic programs at runtime?

For example, of program READ.BAS is used to read records from a data file specified by the user. It might begin like this:

1000 INPUT "Give File Name ", D$
1010 OPEN D$ FOR INPUT AS #1
1020 .......

When executed by

QBASIC /RUN READ

the user will be prompted to supply a file name.

My question is, can this file name be suppied at the QBASIC call, eg:

QBASIC /RUN READ(filename)

Thanks.

Bill
Stormy

Post by Stormy »

Maybe you want to something like this:

The Command you started the program:

Code: Select all

QBASIC /RUN Chooser.bas File01.bas
Code in Chooser.bas:

Code: Select all

OPEN COMMAND$ FOR INPUT AS #1
READ #1, a$
CLOSE #1
OR:

Code: Select all

RUN COMMAND$
You only just use the parameter for your handling.
Post Reply