Information générale
Catégorie:
Gestionnaire d'écran & Écrans
I wasn't talking about the array generated by amemebers, but about the fact that it's included as an element of the array, in other words it's considered an object by amembers(aArrayName, 2), which sounds logical, AFIK the DE is an object. I think the question was why the DE is not in the objects collection, but amembers considers it a member object of the form, alongside command buttons and other controls.
But the whole problem was the fact that I was using the value returned by amembers to detemine the number of objects, and then used the number in a for-next statement to loop through the Objects collection, hence the off by 1 error(because of the DE). But since I'm now just using FOR-EACH to loop through the objects it's no longer a problem.
>Jorge,
>
>The amembers() function does create a real array. Don't confuse this array with the native collections.
>
>I think help and docs label collections as arrays because you access it just like an array, but as you found collections don't work in functions like alen(). The Controls, Objects, DataEnvironment, Pages etc collections exist in the appropriate container classes.
>
>>>Because the Form.DataEnvironment is it's own collection.
>>
>>So it's not an object then, but it's not an array either, it's a...collection :). Why does AMEMBERS(aArrayName, 2) which according to help:
>>
>>"Specifies that the array contains the names of the objects that are members of the object specified with ObjectName. The resulting array is one-dimensional."
>>
>>include the DE in the array?, I mean, no big deal, there are workarounds, but the terminology is confusing.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement