confused passing array to a function

Post Reply
smabasgil
Posts: 46
Joined: Sat Dec 26, 2015 1:06 pm
My devices: Ipad 2
Flag: Bahamas

confused passing array to a function

Post 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 ?

User avatar
Dutchman
Posts: 851
Joined: Mon May 06, 2013 9:21 am
My devices: iMac, iPad Air, iPhone
Location: Netherlands
Flag: Netherlands

Re: confused passing array to a function

Post 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 '(,)'

smabasgil
Posts: 46
Joined: Sat Dec 26, 2015 1:06 pm
My devices: Ipad 2
Flag: Bahamas

Re: confused passing array to a function

Post by smabasgil »

Okay thank you

Post Reply