This is out of the DBP Guide
Quote: "
OK, earlier I said that in DB, global variables don't officially exist. Well they don't, but there is a work-around
you can use if necessary.
It turns out that arrays declared using DIM in your main program are sort of global in so much as you can see
them inside functions, alter their contents inside the function and the alterations are intact in your main
program when you exit the function!
This gives us a very nifty way around the fact that you can only pass a single variable back from a function.
With arrays we have no need to pass more than one as we can use arrays.
Arrays declared inside a function however are still local and are destroyed on exit. They cannot be seen on
return to the main program. Also, as they are destroyed when exiting the function, you can DIM an array at the
start of a function and call it many times without getting an 'Array Already Dimensioned' error. You don't have
to 'Undim' as you would in the main program.
This also conveniently gets around the limitation mentioned earlier that you cannot have an array in the
parameter list you pass to a function. Now you don't need to as the array can be seen and modified inside the
function anyway!"
So how do you do this? I know the guide is kind of old and I am sure some things have changed but how would you modify an array that is outside a function from within a function?
Thanks
Dragonslayer