Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with SCATTER objects
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01346335
Message ID:
01346557
Views:
9
Hi Jon.

>I have a section of code that loops through a view. Depending on certain conditions, I do a SCATTER of the current record to an object named oRecord and change any necessary property values so that I can insert a new record into the view from oRecord. Since I don't want to ruin the record pointer in the middle of the loop (or process the inserted records within the loop), I instantiated a collection object to hold all of the oRecord objects. My plan was to iterate through the collection after the main loop was done and insert records from the oRecord objects contained in the collection.
>
>Unfortunately, this doesn't work. For whatever reason, the insert creates a blank record in the view. Why would this happen? When I compare the object from the collection with the object that was created from the SCATTER, all of the properties are exactly the same. Yet, the insert doesn't work when the object is referenced from a collection.

When you retrieve the object from the collection, use the FOXOBJECT keyword to ensure it's a VFP object and not a COM object, which VFP treats differently.

Doug
Previous
Reply
Map
View

Click here to load this message in the networking platform