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:30:44
 
 
To
10/02/2011 20:49:55
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01499709
Message ID:
01499711
Views:
77
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform