Page 1 of 1

ARRAYS

Posted: Mon Oct 09, 2006 4:37 pm
by dave
i have this code:

INPUT "Total contestants";c

FOR T = 1 TO C
INPUT "NAME";NAME$
INPUT "TICKETS";T
NEXT T

NOW WHAT I NEED TO KNOW WHAT TO DO IS HOW ASSIGN THE NAME AND TICKETS TO DIFFERENT VARIABLES FOR WHEN IT GOES AROUND THE LOOP SO WHEN T = 1 IT WILL ASSIGN NAME$ AND T TO NAME1$ AND T1
WHEN T = 2 IT WILL ASSIGN THE NEW NAME TO NAME2$ AND T2 AND I NEED IT TO BE ABLE TO ASSIGN DIFFERENT NAMES TO THE DIFFERENT VARIABLES TO ANY AMMOUNT OF TIMES

Posted: Mon Oct 09, 2006 4:45 pm
by {Nathan}
Pay attention in class, ask your professor for help, or go use one of the 600+ tutorials on this site. I recommend a set written by Vic.

Posted: Mon Oct 09, 2006 6:12 pm
by bungytheworm
At first, DONT YELL :lol:

Use arrays. As nathan sayd, give attention.

For i = 1 TO 10
Array("what we should have here?") = i
Next i

Posted: Wed Oct 11, 2006 6:41 am
by Quibbler
You can't use T twice (you have FOR T=... and INPUT T...)
for your other problem arrays are the answer

FOR I=1 to N
input "name";name$(i)
input "tickets";t(i)
next i

Don't forget is you're going over 10 you will need to dimension these arrays.