Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using the collection class
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00899345
Message ID:
00899354
Vues:
15
Nick,

It puts 10000 references to the same object into the collection. If you want 10,000 different objects move your oItem = createobject() inside your loop.

>Am I doing this wrong, does this create a different oItem for each iteration or does it just create a link to the same object each time.

>
oCol=CREATEOBJECT("Collection")
>oItem=CREATEOBJECT("Empty")
>	AddProperty(oItem, "MyProp1", "One")
>
>FOR nCount=1 TO 10000
>	oCol.Add(oItem)
>ENDFOR
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform