Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to create collections?
Message
De
06/03/1998 13:41:42
 
 
À
06/03/1998 13:34:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00082693
Message ID:
00083079
Vues:
28
>>>I want to create an object and need this object keep an array of other objects. How can I do it?
>>>
>>>I mean, how to create a behavior similar to that in pageframes, containers, forms or so, that keeps a collection of objects inside a single object? Even more, how could it keep track of the number of elements?
>>
>>Use property-array and ALEN(thisform.amyarray) will return the number of elements. Any time you add/remove new member, you will redimension this array.
>
>Thanks for your help. But it's not clear enough to me how to achieve what I'm looking 4. Would you please give me a more specific help on this?

oCustom=createobject('MyClass')
oCustom.addobject("Label1","Label")
Dimension oCustom.Mycollection(ALEN(oCustom.Mycollection)+1)
oCustom.Mycollection[ALEN(oCustom.Mycollection)]="Label1"
return

DEFINE Class MyClass AS Custom
Dimension Mycollection(1)
Mycollection[1]="None"
ENDDEFINE
Edward Pikman
Independent Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform