Arrays are like variables, but can hold multiple things. Example:
dim Example(1000)
for A = 0 to 1000
example(A)=A
next A
this will make an array that can hold 1001 integers, the for next loop fills the array with integers, so
example(0) = 0
example(1) = 1
etc.
Why do you want to use arrays?
If you want to make a strategy game, you may want to use:
dim Unit_Health(999)
so you can store the health of 1000 units.
Thats much better than:
Unit_one_health=10
Unit_two_health=10
etc etc etc
But this is also possible:
dim Unit_Position#(999,2)
for a=0 to 999
Unit_Position#(a,0)=object position x(a)
Unit_Position#(a,1)=object position y(a)
Unit_Position#(a,2)=object position z(a)
next a
Now its up to you, you can use thousand variables or just a single array.
How to use them
DIM makes a new array
DIM array_name(amount)
To put a thing (integer/float/string/etc) into an array is an easy task, its just like using variables
DIM array_name(100)
array_name(index_number)=value
just replace index_number and value with numbers and that value is stored in that array_name(index_number)
the index_number ranges from 0 to *the number you used to DIM it*
in this case
( DIM array_name(255) )
it would be 0-255
Quote: "
Amd 2500+ | 1024mb pc2700 | A7N8X-X | Geforce4 ti 4200 128mb"