Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Save an array ... into an array or collection
Message
De
10/02/2011 21:30:44
 
 
À
10/02/2011 20:49:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01499709
Message ID:
01499711
Vues:
79
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform