PDA

View Full Version : qBASIC Programming Help


Big Bill
06-10-2004, 08:25 PM
I have written a simple program in qBASIC and have not used numbers for each line of instruction. What command do I use in the last line of instructions that will take me back to the first line for the program to run again, in this case the first line asks for an enty of the distance of a race?

Big Bill

BillW
06-10-2004, 08:30 PM
Originally posted by Big Bill
I have written a simple program in qBASIC and have not used numbers for each line of instruction. What command do I use in the last line of instructions that will take me back to the first line for the program to run again, in this case the first line asks for an enty of the distance of a race?

Big Bill

Big Bill,

Try putting a "1" (one) in front of the first statement and a "GOTO 1" at the end ... both without the quotes.

Optionally a label such as

"start:"

can be put in front of the first statement

"GOTO start"

at the end.

Bill

Big Bill
06-10-2004, 08:41 PM
Bill,

That works. However, what instruction and where can I put in the program for it to end if I don't want to run it again?

Really appreciate your fast response to my question.

Big Bill

BillW
06-10-2004, 08:49 PM
Originally posted by Big Bill
Bill,

That works. However, what instruction and where can I put in the program for it to end if I don't want to run it again?

Really appreciate your fast response to my question.

Big Bill

Try something like (I'll leave out the editorial quotes this time i.e. the quotes appearing below are part of the program)


INPUT "Enter 1 (one) to quit"; entry

IF entry <> 1 THEN GOTO start

BillW
06-10-2004, 08:52 PM
This looks like a reasonable, but brief reference:

http://www.qbasic.com/

Probably a search of Google would provide some more information.

Bill

Big Bill
06-10-2004, 10:41 PM
Bill,

Your last suggestion resolved the problem and I thank you so much for your help.

Big Bill

JustRalph
06-11-2004, 12:17 AM
BillW

We are getting old............. I actually remembered how to do that too..........but I can't remember my way around town sometimes...........

BillW
06-11-2004, 12:27 AM
Originally posted by JustRalph
BillW

We are getting old............. I actually remembered how to do that too..........but I can't remember my way around town sometimes...........

My last basic experience was a more primative Level II basic (mandatory line nos. and 1 or 2 character variables only) on a TRS-80 model I in maybe 1982. Wow, 22 years ago!

BTW, Big Bill what machine/OS are you running that on? I thought QBasic was a DOS only language (Never using Microsoft stuff, I could be totally wrong :confused: )

Bill

Jeff P
06-12-2004, 02:13 PM
Oddly enough I cut my teeth programming in QBasic. And oddly enough, it still runs just fine on today's Windows operating systems. It isn't used today because many other programming languages came along that offer so much more in the way of scalability, capability, general aesthetics, and overall ease of use.

Big Bill
06-12-2004, 06:04 PM
BillW,

In answer to you question, my Dell has Windows 2000 as the O/S and it does have the DOS Qbasic on it.

And thanks again for your help. I had pulled my copy of Carroll's "Handicapping Speed" out for a re-read and saw where I could obtain his speed ratings by creating a little program in Qbasic from info furnished in his book.

Big Bill