Page 1 of 1

Passing array to function

Posted: Fri Jun 18, 2004 6:49 am
by giuseppe
Hi.

I'm tryng to pass an array to function, but i have a problem when I use it.

Can you help me?

Thanks in advance.

Posted: Fri Jun 18, 2004 7:30 am
by acb
Can you elaborate the question, I mean, what sort of problem you are getting.

Regards,
Bhanu.

Posted: Fri Jun 18, 2004 5:24 pm
by ray.wurlod
Can you show us what you're trying to do?

It's certainly possible to pass an array to a function. Do you mean a dynamic array - which is only a character string, so ought not to present any problem? Or do you mean a dimensioned array, in which case there are some rules you must heed.

Read about the CALL, DIMENSION and MAT statements in the BASIC manuals to learn more.

Essentially, though, you must precede the dimensioned array argument's name both in the function/subroutine argument list and in the caller's argument list with the keyword MAT. The array must be dimensioned in the caller, and must be dimensioned in the called function/subroutine too (but only to specify one-dimensional or two-dimensional array; actual extent sizes are ignored).

THANKS

Posted: Mon Jun 21, 2004 1:41 am
by giuseppe
I' tryng to pass a DIMENSION ARRAY to FUNCTION written with client MANAGER.
Thr problem was that in argument's tab i can write only alpha-numeric-character (e.g. "MAT arg1" i can't write).
Using your suggestions and re-declaring the argument like a dimensioned-array in function, I have resolved the problem.

THANKS a lot.