You can pass an array as a regular parameter.
DIM MYARRAY[2]
MYARRAY[0]=9
MYARRAY[1]=15
PRINR ARRFUNC(MYARRAY)
DEF ARRFUNC(ARRAY)
FOR I%=0 TO LEN(ARRAY)-1
INC RETURNS, ARRAY[I%]
NEXT
RETURN RETURNS
END
If everthing went well, you should see 24 in the console
No, the % is an integer suffix. You can still use doubles. You can pass array elements exactly the same as literals.
DIM ARR[1]
ARR[0]=7
MAIN(ARR[0])
Works the same as
MAIN(7)
The function has no return values. To make a function with no returns, use the following syntax:
DEF FUNCNAME [PARAMS1,...]
DEF MYCMD HI$, COUNT
PRINT HI$*COUNT
'prints the given string COUNT times
END
You get the gist. Check the help for DEF for more info.
This is conflicting. DEF doesn't mention about passing arrays in the reference list, unless I read it wrong. If I can pass arrays, but I am doing something wrong in the screenshot in the above post, then it has to be the function parameters. I have to pass a size of the array? And this applies to all functions passing arrays?
Besides, I didn't see how to pass multiple arrays as function parameter
If it did return something, you need to set something to that value or use that value. However, since it does not, you need to omit the parenthesis.
DEF MAIN T
Instead of DEF MAIN(T). That would work.