Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Columnorder equals zero?
Message
From
12/05/2006 10:07:41
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
11/05/2006 11:57:44
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01120588
Message ID:
01121300
Views:
23
>>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform