Referencing a n array from a function
Posted: Fri Oct 11, 2024 8:25 pm
G’day,
Can anyone tell me how to reference a main code array from within a function?
I have several functions that are passed a set of values. The functions are supposed to use the values to lookup an array and return the value of the array. Sort of like this:
DIM array(7,7,3)
Def Func1(a,b,c)
“Set up”
Result1=array(a,b,c)
“Do something with result1”
Func1=result2
End def
MainLoop:
“Calcuate some values a, b, c)
Result=Func1(a,b,c)
IF Result=1 THEN
Do something
ELSE
Do something else
END IF
Can anyone tell me how to reference a main code array from within a function?
I have several functions that are passed a set of values. The functions are supposed to use the values to lookup an array and return the value of the array. Sort of like this:
DIM array(7,7,3)
Def Func1(a,b,c)
“Set up”
Result1=array(a,b,c)
“Do something with result1”
Func1=result2
End def
MainLoop:
“Calcuate some values a, b, c)
Result=Func1(a,b,c)
IF Result=1 THEN
Do something
ELSE
Do something else
END IF