Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Kickin around memory variables?
Message
From
24/05/2001 11:50:32
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00510941
Message ID:
00510961
Views:
13
>I have a form with pageframes. It worked beautifully with buffering. But I dumped buffering and switched to SCATTER MEMVAR MEMO and GATHER MEMVAR MEMO at the request of my leader. Consequently, I am still debugging the form with pageframes. Here are some questions that I am pondering that weren't there before.
>
>1. I thought SCATTER created memory variables from fieldnames, but yet they don't seem to save on a GATHER unless I declare the variables as PUBLIC. I thought SCATTER took care of that for me? Huh?
>
>2. I am confused as to when I need the "m." in front of the variable name. Some references seem to work without it while some seem to require it to work properly. Should I always use m.variable as a rule when using SCATTER/GATHER.
>In all code referencing the field and in all controls Control Source put the "m."?
>
>3. I also noticed that only the top pageframe form fields were saved when I did GATHER MEMVAR MEMO. It seems that the second and third pageframes within the same form had form fields did not save when I did a GATHER MEMVAR MEMO. I suppose if I declare those fields as m.fieldname using PUBLIC fieldname the fields will save properly.
>
>Thanks for helping me to better understand this.

Steve,
First option is to have a revolution to kick out your leader :)
1) True it uses fieldnames and gather successfully gathers them. However you might have scattered to an array where no fieldname is used. Also saying public it sounds you scatter in a method and try to gather from other. There a scope problem. You could overcome it by scatterring to an object. ie (custom form property oRecord exists) :
scatter name thisform.oRecord
gather name thisform.oRecord
2)Yes you should. If you don't use m. and same name exists in current alias it takes precedence. ie:
m.employeename = 'me'
would work while :
employeename = 'you'
would fail if current table had a field named employeename.
3)Probably where you called other fields m. counterparts were nonexistent causing them to use their default. Public approach while could be used sounds unnecessary and even considered as a bad design by some.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform