Posts: 17
Threads: 5
Joined: Feb 2002
how do I display the pos number of the for loop? for example:
Code:
input "Enter amount of values to enter: ",c
for x = 1 to c
input "Enter value number: " + x
next x
the + x obviously won't work, but how do I tell it to enter value x, the position the for loop is on?
thanks
Posts: 594
Threads: 11
Joined: Oct 2002
Quote:Code:
input "Enter amount of values to enter: ",c
for x = 1 to c
input "Enter value number: " + x
next x
Try this:
(EDIT)
Code:
input "Enter amount of values to enter: ",c
for x=1 to c
Print "Enter value number"+str$(x)
input ,var
next x
B 4 EVER
Posts: 17
Threads: 5
Joined: Feb 2002
thanks for the quick reply
unfortunatly, didn't work, the editor is saying it expect a ; or ,
Posts: 6,419
Threads: 74
Joined: Mar 2002
First of all, you'll need an array to store things...
Code:
INPUT "Number of elements"; a%
DIM var%(a%)
FOR i% = 1 TO a%
PRINT "Enter élement no. " + STR$(i%);
INPUT var%(a%)
NEXT i%
Posts: 704
Threads: 0
Joined: Dec 2002
where you INPUT var. (You shouldn't need it since there isn't a prompt string.)
Quote:thanks for the quick reply unfortunatly, didn't work, the editor is saying it expect a ; or ,
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Posts: 704
Threads: 0
Joined: Dec 2002
only to arrays.
Quote:First of all, you'll need an array to store things...
Code:
INPUT "Number of elements"; a%
DIM var%(a%)
FOR i% = 1 TO a%
PRINT "Enter élement no. " + STR$(i%);
INPUT var%(a%)
NEXT i%
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Posts: 6,419
Threads: 74
Joined: Mar 2002
Do you always have something to point out? I am fearing to reply a message right now 'cause maybe my post is not perfect!
Posts: 749
Threads: 4
Joined: Jun 2002
Sir, "Travelling Curmudgeon" isn't just his signature. It's his lifestyle.
img]http://usuarios.vtr.net/~disaster/sigs/annoyizer.php[/img]
Posts: 704
Threads: 0
Joined: Dec 2002
It's not my fault there's so much misinformation in the world.
I'm only one guy. (It's a dirty job, but someone has to do it.)
However, if you're going to misidentify what the problem is that someone's having and cause people to think they *have* to obey some rule that doesn't exist, well..., yeah..., I'm going to be an obstacle.
Quote:Do you always have something to point out? I am fearing to reply a message right now 'cause maybe my post is not perfect!
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.