Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SCATTER and GATHER
Message
From
17/03/1999 23:27:07
 
 
To
17/03/1999 19:27:57
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00198953
Message ID:
00199044
Views:
21
Hi Steve, Ed ---

Steve --- take Ed's advice: Allow me to add a small point, if the changes saved anyway you may have had the control bound to the data (check controlsource property).

In fact SCATTER/GATHER is a great way to buffer to an object, which allows you to play with the data source. *But* the way SCATTER and GATHER are applied in VFP is vastly different from how they were used in FPW or FPD so watch what you use as a reference to experiment.


>>I have never needed to use SCATTER and GATHER before. I have a couple of questions about them.
>>
>>Can SCATTER MEMVAR follow the SELECT mytable command?
>>
>>If I have a form with Add/Save and an Edit/Cancel button,
>>can I put GATHER MEMVAR inside the Save code and leave it out of the Cancel code. When I press Add or Edit buttons, they change to Save and Cancel buttons.
>>
>>I ran a test and Added a new record to my table after pressing the Save button, but when I Edited the record and pressed Cancel to destroy or revert my changes, the changes saved anyway.
>>
>>Does this mean that I can't have a ControlSource for mytable any more, if I am using SCATTER and GATHER? I am a bit confused as to how to work the Cancel button (revert changes) when it comes to GATHER.
>>
>>I assumed I didn't put GATHER MEMVAR and the changes would not be saved, but they were.
>>
>>Please help. I was using table buffering and did TABLEUPDATE and TABLEREVERT, but the client wants me to use SCATTER and GATHER instead because we are getting too many "table buffer" errors using table buffering.
>
>Firstly, SCATTER/GATHER are used mostly for non-buffered schemes. You may get good OO results here if you will use SCATTER/GATHER NAME oMyobject, i.e. work with objects and not with memory variables.
>In regard to splitting your code: I don't see any particular problem. I believe you already doing this, e.g.
>***cmd.click event
>IF This.Caption="Edit"
>**run some code
>ELSE && i.e. Save
>**run other code
>ENDIF
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Reply
Map
View

Click here to load this message in the networking platform