just use it! eg:
sync on:sync rate 40
set text opaque
dim a(10)
fill_array()
ac=1
do
for i=1 to 10
text ac,i*20,str$(a(i))
next i
ac=ac+1
if ac>300 then ac=1
sync
loop
function fill_array()
for i=1 to 10
a(i)=rnd(200)
next i
endfunction
allows you to fill the array inside a function, and then uses the array in the main loop, like wise the array could have already had values in it, they could then be modified inside the function eg:
sync on:sync rate 40
set text opaque
dim a(10)
rem fills the array with values
for i=1 to 10
a(i)=rnd(200)
next i
add_one_thousand()
ac=1
do
for i=1 to 10
text ac,i*20,str$(a(i))
next i
ac=ac+1
if ac>300 then ac=1
sync
loop
function add_one_thousand()
for i=1 to 10
a(i)=a(i)+1000
next i
endfunction
creates some values outside the function, fills the array, then calls the function to add one thousand to the values, then uses the result in the main loop, arrays are global, I don`t have an issue with it but the OOP bunnies get all excited
Mentor.
PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, Nvidia FX5900 gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster.