Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determining number of objects in a form
Message
De
24/11/1999 16:57:13
Jorge Haro
Independent Consultant
Juarez, Mexique
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00294135
Message ID:
00295331
Vues:
34
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
Fil
Voir

Click here to load this message in the networking platform