Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
displaying the position number of the for loop
#1
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 Smile
Reply
#2
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
Reply
#3
thanks for the quick reply Smile unfortunatly, didn't work, the editor is saying it expect a ; or ,
Reply
#4
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%
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#5
where you INPUT var. (You shouldn't need it since there isn't a prompt string.)



Quote:thanks for the quick reply Smile 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.
Reply
#6
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.
Reply
#7
Do you always have something to point out? I am fearing to reply a message right now 'cause maybe my post is not perfect!
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#8
Sir, "Travelling Curmudgeon" isn't just his signature. It's his lifestyle.
img]http://usuarios.vtr.net/~disaster/sigs/annoyizer.php[/img]
Reply
#9
It's not my fault there's so much misinformation in the world. Smile 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. Smile


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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)