Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Save an array ... into an array or collection
Message
From
10/02/2011 21:37:20
 
 
To
10/02/2011 21:30:44
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01499709
Message ID:
01499712
Views:
58
Well --

I was hoping for a way to save the entire cursor each time, not just the changed records.

And I was hoping there was some nice way to do so without actually iterating through all the fields and records.

I can't seem to do it with any of the array functions, I'm gonna see if using XML could be the way to go.


>Create an variable and assign it to an instance of an "empty" class. Now you can add properties to the object for each field. You could use AFIELDS to get an array of the fields and then add as a property to the object. Now you can save the values to the object; and in turn save the object to a collection.
>
>
>loInstance = CREATEOBJECT("EMPTY")
>lnNumFlds = AFIELDS(laFields,"cursor_alias")
>FOR lnNdx=1 TO lnNumFlds
>    ADDPROPERTY(loInstance, laFields[lnNdx,1], "")
>ENDFOR
>
>
>Now you have your Instance object which can store the values. You would then save it to the collection and reset the values for the next record to save.
Jim Nelson
Newbury Park, CA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform