Page 1 of 1

confused passing array to a function

Posted: Thu May 11, 2017 4:28 pm
by smabasgil
When you pass a single dimension array to a function, it is OK.

Now i intend to code a function dealing with a multi dimension one.

dim pilcarmar(18)
dim tascarmar(18,2)
.
.
.
call splitpile(pilcarmar,tascarmar)
.
.
.
def splitpile(pilori(),pilspl())
end def

I receive the error message : Wrong number of arguments using array "PILSPL"

Is it even correct to deal with a multi dimension array parameter ?

Re: confused passing array to a function

Posted: Fri May 12, 2017 8:11 am
by Dutchman
You should indicate in the parameter-list of the function definition that it refers to a two-dimensional array.
So def splitpile(pilori(),pilspl(,)) instead of def splitpile(pilori(),pilspl())
So NOT '()', but '(,)'

Re: confused passing array to a function

Posted: Fri May 12, 2017 12:56 pm
by smabasgil
Okay thank you