[futurebasic] [FB][FB^3] Passing back array data from FN

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 2000 : Group Archive : Group : All Groups

From: Michael Malone <crochety@...>
Date: Wed, 31 May 00 22:22:20 -0700
Brian J. Hughes had a question on passing an array by reference.
I have a fundamental question which I would like to add. Has to do with passing back array data from a function.

If I read the eDOC Reference Manual correctly (p 231), an array is DIM'ed in a FN call like so:

LOCAL FN MyFN(Array1%(10,2))

and presumably called in the .MAIN program (I'm using PG) like so:

FN MyFN(ArrayName%(10,2))

According to the manual:
"All of the array¹s elements are accessible to the function.  Any changes that are made to the array¹s elements within the function will also affect the array outside of the function"

As I read it, I should get values in ArrayName%(10,20) which may have been set in the LOCAL FN after it has completed executing.
Well, in my case  -  no such luck!  I can pre-load the array before the FN call, reload it with different data in the LOCAL FN (verified by reading the array contents back inside the FN), but after completion of the FN, the original pre-load is in ArrayName%(10,2).

Whazzup here ? Anybody?  T.I.A. !


=====================
Mike Malone
crochety@...
=====================