Finish program

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
Anonymous

Finish program

Post by Anonymous »

Could you please finish this short program for me so that I do not have to re-enter the three numbers
each time i use the program. I would like to enter the numbers once and then have the program select a new
number upon request without inputting the numbers a second or third time. That way i can get as many numbers as i
please after opening the program. Thank you so much for your help.

E. Spears.

CLS
DIM item$(1 TO 3)
INPUT "Item 1: ", item$(1)
INPUT "Item 2: ", item$(2)
INPUT "item 3: ", item$(3)

RANDOMIZE TIMER

n=INT(RND * 3 +1)

CLS

PRINT "The item that was selected was "; item$(n); "."
Pritchard
Coder
Posts: 15
Joined: Mon Jun 12, 2006 12:19 pm

Post by Pritchard »

Here. Learn OPEN and save the numbers to a text file. Check if the text file exists. If it exists, don't have to have the numbers input, just read them.

. . . No one's going to do your work for you but we'd definitely love to teach you methods of doing what you want.

EDIT: Btw, wrong forum?
User avatar
{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:

Post by {Nathan} »

Pritchard wrote:EDIT: Btw, wrong forum?
This was a question, and that was a answer. Hence the name "QBASIC Questions and Answers."

Maybe you... uhh... can't read? :-p
Image
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

Nathan1993 wrote:
Pritchard wrote:EDIT: Btw, wrong forum?
This was a question, and that was a answer. Hence the name "QBASIC Questions and Answers."

Maybe you... uhh... can't read? :-p
Maybe uh... you need to think?

I moved the topic... Uhh... maybe you uhh... are looking kind of uhhh... stupid now? :P :wink:
I have left this dump.
User avatar
{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:

Post by {Nathan} »

Z!re wrote:
Nathan1993 wrote:
Pritchard wrote:EDIT: Btw, wrong forum?
This was a question, and that was a answer. Hence the name "QBASIC Questions and Answers."

Maybe you... uhh... can't read? :-p
Maybe uh... you need to think?

I moved the topic... Uhh... maybe you uhh... are looking kind of uhhh... stupid now? :P :wink:
Yes, I am looking rather stupid now.

<_<
>_>

*runs and hide's in the corner and cuts wrist*
Image
Post Reply