okay um

still not 100% about this whole thing but...

seems like what you want can be done with MOD

like lets say your array has 5 slots like youre saying

so, theres 5 'slots' at the 6th, we start back at the first, etc..

so lets use a variable x%. x% = number of slots.

*x% = 5*in order to determine which slot to use based on this system, you only need to do

*tehindicewewant% = theinputfromuser% MOD x%*so, lets make a sample prog:

dim thisisafiveslotarray%(1 to 5)

'fill them with junk

thisisafiveslotarray%(1) = 12

thisisafiveslotarray%(2) = 23

thisisafiveslotarray%(3) = 34

thisisafiveslotarray%(4) = 45

thisisafiveslotarray%(5) = 56

x% = UBOUND(thisisafiveslotarray%)

'This puts 5 into x%.

input "Put in a number: ", userinput%

tehindicewewant% = userinput% MOD x%

? "The array ended up on slot number"; tehindicewewant%

? "The value stored in this indice is"; thisisafiveslotarray%(tehindicewewant%)

hope this makes sense and wasnt overly complicated <.<

edit: realized it would be clearer to not work with a zero indexed array

well i guess ill explain MOD in case anyone doesn't know what it does. Basically MOD takes a number, divides it by another number, and only takes the

*remainder of the division*so 12 / 8 would be 1,, with a remainder of 4

*x% = 12 MOD 8*. x% is 4

an easier way to think of it is like a slicer, you have a line of numbers and MOD is the size of the slice

lets say we have 7 as our userinput from the above program

would be that in a strip

now if we were to use 7 MOD 5, we would be slicing the strip into 5's

so 7 MOD 5 would return 2

(yes im really bored thats why im explaining it so detailed)

but hey maybe it will help someone ;p

editted like 87162487 times