Subject Re: Control passing back and fro in a form sub routine
From Bruce Beacham <bbeacham@no-plm-lowman.co.uk>
Date Thu, 27 Jul 2023 11:44:26 +0100
Newsgroups dbase.getting-started

Define a private variable in the calling function, and in the called
function that variable is available (as long as you don't define a
further variable with the same name) for the called function to change
its value.

I find that gives more trouble than it's worth.   Far better to pass a
variable in a function call and pass back a return value (which can be
an array containing multiple return values, or an assocarray with keys,
or even a plain object with properties attached to it, as Mervyn points
out).    The called function is thereby much more self-contained and
versatile.


Bruce Beacham

On 26/07/2023 11:16, Akshat Kapoor wrote:
> I have lost touch (all thanks to reduced programming time) but there
> used to 2 methods of passing value.
>
> One of them used to be reference. You change the value in function and
> the host value is also changed.
>
> In C it used to be something like adding & to the memory variable and
> the memory address would be passed.
>
> I do not remember using something similar in dbase.
>
> Regards
> Akshat