Subject Re: Control passing back and fro in a form sub routine
From Akshat Kapoor <akshat.kapoor@kapoorsons.in>
Date Wed, 26 Jul 2023 15:46:46 +0530
Newsgroups dbase.getting-started

Good Evening Mervyn,

>> The value returned by square.prg will be displayed. I am posting code
>> BUT it may cause complications due to use of Public variables.
>>
>>      Public mform
>>      mform = form
>> What happens to form after the end of the form is untested. It will be
>> released from memory or not I cannot say.
>
> The use of Public variables, and user-defined properties of the _app
> object which are their counterpart in OOP, has it's place but one should
> really only use them as a last resort when there is no other way.

I avoid public variables like I would avoid Covid. My personal
preference is custom properties of form but there are situations where
this cannot be avoided.

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