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:
01346337
Views:
10
>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.
>
>Any ideas on this or should I use a different approach?

Not sure why it didn't work this way, but you can create a temporary cursor for the insertion, this probably would be faster than collection.

You can also post some code, may be there is an error in the way you're doing it.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform