Thread: arrays
View Single Post
  #3  
Old 03-10-2002, 05:43 AM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
quite simple

a array is like a lot of variables all in one variable

u can set variables like this:

arrayname={0,0,0}

or setarrary arrayname,3;

each would produce the array, arrayname={0,0,0}

and u can use variables out of the array by using indexes, like this

lets say there is a array 'nums' and it is equal to {3,5,7}
say2 #v(arrayname[index]);
so if the index was 2 it would show 7

u must remember that the indexes start with 0, not 1

so

nums[0] - 3
nums[1] - 5
nums[2] - 7

also, if you want to set a value in a array, just do this:

arrayname[index]=whatevervarialbe;
__________________
[signature]insert here[/signature]
Reply With Quote