Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scatter and Gather
Message
From
14/11/2015 07:15:16
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
13/11/2015 14:20:31
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01627387
Message ID:
01627422
Views:
75
>SCATTER MEMVAR used to be a most useful technique for data managing but there are automated alternatives now such as Views, Cursoradaptors or even SCATTER to an object.

Cursoradapters seemed almost redundant when they came, as we've all developed our own techniques to do what they do... but they actually do much more, so you get more control than ever before. And you aren't dependent on a dbc (as with views), all you need is a prg with code to set the properties as you like them.

As for scatter/gather itself, it made my life so much easier when it first appeared, even though it first did arrays only and not memos. Then it got memos too, and then it got the memvar option, but that was still nasty, because you got memvars and fields with exactly same names. And if you forgot to use mdot, you'd get weird results - and too many variables to be comfortable with. Scatter name (i.e. scatter to object) is, IMO, the best of all. It reduces the clutter, it's just one variable per record; the object doesn't have to have all the properties - you can start with createobject("empty") and addproperty() just the fields you want; you can pass the object as parameter to code residing in a different datasession, thus bridging that gap.

The only gotcha is when you pass it as a parameter to a routine which does scatter a few more fields to it - you MUST add the Additive keyword, or else your object is destroyed and new one created, thus losing whatever was in it before.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform