Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Collection Object
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00273466
Message ID:
00273527
Vues:
17
Yes! Thanks. That's exactly what I was looking for.

Scott


>Using the Container class, this would be:
>
>MyCollection = CreateObject("Container")
>
>*-- To add an object:
>=MyCollection.AddObject(sys(2015), "Custom")
>
>*-- To use an object:
>?MyCollection.Controls[1].Name && Or whatever other property/method you may need instead of Name.
>
>Obviously, You can use your own classes where I used "Custom". Sys(2015) generates a unique name.
>
>Isn't this exactly what you want?
>
>Vlad
>
>>Thanks again for the reply. I had already tried using the Container object, but it doesn't let me add a "collection" of objects. In other words, this doesn't work:
>>
>>MyContainer.AddObject( "MyObject(1)", "cusObject" )
>>MyContainer.AddObject( "MyObject(2)", "cusObject" )
>>
>>Neither does this work:
>>
>>MyContainer.AddObject( "MyObject", "cusObject" )
>>MyContainer.AddObject( "MyObject", "cusObject" ) && fails- name already exists
>>
>>These don't work because you must have a UNIQUE object name whenever you call AddObject. I don't want a unique object name. I want the same object name with an item index.
>>
>>If you've ever used the ListItems ActiveX collection object with the ListView ActiveX control, you'll see what I'm talking about.
>>
>>I'm trying to accomplish this:
>>
>>MyObject.MyCollection(nItemIndex).ItemPEM
>>
>>As an example, with the ListView ActiveX control, this would be:
>>
>>ListView1.ListItems(1).Checked
>>ListView1.ListItems(2).Checked
>>ListView1.ListItems(3).Checked
>>
>>ListItems is a Collection object referenced by an item index in "( )".
>>
>>I just want to accomplish the same structure with my own custom VFP classes.
Scott A. Keen
MCP

"I'm not in denial. It's just not my fault."

"So long and thanks for all the fish."
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform