Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Objects vs. Controls/Columns/etc. collections
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00661704
Message ID:
00666372
Vues:
24
Hi David,

>The Objects[] and Controls[] collections will only ever have contained objects in them, those dropped onto the form at design time, or created at runtime via AddObject() method calls.
>Any object that is created via CreateObject() or NewObject() and assigned by reference to an object property are not "contained" by the object so they will not be in the Objects[] collection. You can use amembers() to get to these kind of objects.

Thanks for your reply! For the purpose I wanted to use the objects collection, the contained objects are enough.

Just wanted to get around the different coding for each container class which has a collection that holds references to it's contained objects. Just wanted to replace all the IF .BaseClass == "Pageframe" then use Pages, IF .BaseClass == "Grid" use Columns, etc.

I'm using Objects now and didn't experience anything bad so far. Do you think there is any disadvantage using the Objects collection for this? When I wrote the original message I was wondering, if there might be other differences to the "original" collections, since the order in which the references are stored are not the same. That made me think, that Objects was designed for a different purpose than the other collections and it's not execatly the same internally.

Thanks,
Armin

Armin Neudert
Regional Director (Stuttgart) of German FoxPro User Group dFPUG

MCP for Visual FoxPro

Expert/Editor of the VFP section in the German Codezone community portal
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform