Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Columnorder equals zero?
Message
De
12/05/2006 10:07:41
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
11/05/2006 11:57:44
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01120588
Message ID:
01121300
Vues:
35
>>True enough, however, except for the grid, all of these others are containers that may have various types of objects. The grid, IIRC, can only contain columns, so I wonder why it has .objects at all.
>
>There's a good reason for that - it greatly simplifies any code that operates on a generic object, be it a builder or a runtime decorator object's method, or any recursive thing you want to use. Before introductionof .Objects for all container classes, if you want to iterate through all the objects on your form, you had to check for the baseclass of your container, and go through .pages if it was a pageframe, .buttons if it was a commandbuttongroup or optiongroup, and .columns if it was a grid, leaving .objects for just container and custom. The .objects collection makes it much simpler.

It's only a little simpler, IMO.
FOR EACH loObject in THIS.Objects
versus
lcBaseClass = UPPER(THIS.BaseClass)
DO CASE
CASE m.lcBaseClass = "GRID"
  lcObjects = ".COLUMNS"
CASE m.lcBaseClass = "PAGEFRAME"
  lcObjects = ".PAGES"
END CASE
FOR EACH m.loObject IN eval("THIS." + m.lcObjects)
IAC, it's there to be used -- when required.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform