AW: Passing a field reference parameter

Martin Obongita martin.obongita at yahoo.com
Thu Sep 26 08:31:43 UTC 2024


 Hi Rudolf,
I have a list of type instance variable definedfromsqlclass. I have an entry field object its $dataname property is a column in the list. I have navigation buttons: last record btn, previous record btn, next record btn, last record btn. Because the buttons perform the same fetch functions, I create a method to select the line selected. So I pass the line number (+-1) and pass the iList as a field reference. Though the iLine.$selected is kTrue, the entry field does not refresh to reflect the change. This issue is in Omnis 11 community. In Omnis 10.22 works okay. If I change the method and pass a list, select the line and do a quit method iList, the entry field refreshes and displays the new record fetched.
Martin Obongita.



    On Thursday, September 26, 2024 at 09:23:13 AM GMT+3, Rudolf Bargholz <rudolf at bargholz.ch> wrote:  
 
 Hi Martin,

I do not really understand what you want to do here, but what you might mean, is that you cannot use a field reference in the called method that persists the method call. In cases like this, you need to create an instance variable of type item reference in the recipient method/object, and then 

Set reference myInstRef as pFieldReferenceParam

You then use the myInstRef in the recipient object/method, and changing the value of the myInstRef in the recipient will also change the values in the previous caller object instance. This will remain the case even after your method call has been processed, as the original caller variable will be linked to the myInstRef instance variable in the recipient object, similar to a pointer.

Regards

Rudolf Bargholz

-----Ursprüngliche Nachricht-----
Von: omnisdev-en <omnisdev-en-bounces at lists.omnis-dev.com> Im Auftrag von Martin Obongita via omnisdev-en
Gesendet: Mittwoch, 25. September 2024 23:26
An: Andy Hilton <andyh at totallybrilliant.com>; OmnisDev List - English <omnisdev-en at lists.omnis-dev.com>
Cc: Martin Obongita <martin.obongita at yahoo.com>
Betreff: Re: Passing a field reference parameter

I take that back. Actually, in OS11 there is a difference. I noticed that if you pass a field reference, it does not refresh the $dataname property of an object. It could be a bug because in OS10.22 it works fine.



Sent from Yahoo Mail for iPhone


On Thursday, September 26, 2024, 12:03 AM, Andy Hilton <andyh at totallybrilliant.com> wrote:

I don’t believe there is any difference - the end result is the same as far as I am aware
I would put it down to author’s choice !

Andy Hilton
Totally Brilliant Software Inc
Phone (US) : (863) 409 4870 
Phone (UK) : 0207 193 8582
Web : www.totallybrilliant.com 
Helpdesk : https://totallybrilliantsoftware.supportsystem.com/
Email : andyh at totallybrilliant.com

On Sep 25, 2024, at 4:33 PM, Martin Obongita via omnisdev-en <omnisdev-en at lists.omnis-dev.com> wrote:
Hi,
I'm a great fun of passing field reference parameters. It is an easy way of setting values, doing some calculations and getting the results back without the need of a return value.
But sometimes I keep asking myself, when is it necessary to pass a field reference and when should a return value on "quit method" be used instead?
I'd be happy to hear the proper way of working with field ref param.
Thanks.
_____________________________________________________________
Manage your list subscriptions at https://lists.omnis-dev.com
Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 





_____________________________________________________________
Manage your list subscriptions at https://lists.omnis-dev.com
Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 
  


More information about the omnisdev-en mailing list