Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining number of objects in a form
Message
From
22/11/1999 18:56:17
Jorge Haro
Independent Consultant
Juarez, Mexico
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Determining number of objects in a form
Miscellaneous
Thread ID:
00294135
Message ID:
00294135
Views:
73
I'm trying to make a loop to go through all the objects in my form, I've heard this mentioned before, but never seen any actual code.

I'm trying to use the objects collection, in the debugger it says that it's an array, the help file indicates the same but if I use alen(ThisForm.Objects), I get an error saying "Objects is not an array", wrong syntax?.

Anyway I gave that idea up, and tried with amembers, and it kind of worked, with a small problem, amembers counts the dataenvironment as an object, which sounds good to me. But when seen on the debugger the DE is not inside the objects collection, so during the loop I get an error when I get to the last element, the strange thing is that I get "Objects is not an array again", instead of an out of bounds error. There's no problem using ThisForm.Objects[i] to reference individual objects.

For now I'll just substract one from the value returned from amembers, but being such a common process I suppose there's a cleaner way to do it isn't there?, and could anyone explain what's up with the DE not being in the objects collection?
Next
Reply
Map
View

Click here to load this message in the networking platform