Site hosted by Angelfire.com: Build your free website today!

Running QBasic Files (.bas)

Running QBasic files is really quite easy, and there are two ways of doing it, Run and Chain. We'll start off with Run. This has very few options, and the code is as follows:

run "c:\your\file\name\filename.bas"

If you don't specify the .bas extension then QBasic assumes it to be .bas. That was the easiest way to run QBasic files. Now for the hard part, a way to send variables along to those programs you're supposedly running. To do that, you use a Chain command. However, that isn't enough. You have to specify which variables to send along with the Chain command, by using a 'common shared' statement. Here's an example:

common shared yourvariable$ 'you can use any type of variable you want
chain "c:\your\file\name\filename.bas"

To send more than one variable, put a comma between each variable in the 'common shared' statement. I'm not entirely sure this works, because I don't use these commands much. The reason is, if you put these in your program, you can't compile it to an EXE.

Back to the Tutorials...

Email: lnemec@grant.tds.net