General information
Category:
Forms & Form designer
Title:
Determining number of objects in a form
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only