Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
AddObject/RemoveObject
Message
De
22/03/2002 10:50:55
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00635975
Message ID:
00636066
Vues:
20
>>>I don't see what you gain by using this undocumented feature. I would do it this way
  ThisForm.AddObject("Options" + Transform(i), "CheckBox")
>>>ThisForm.aOptions[i] = Evaluate("ThisForm.Options" + Transform(i))
>>>
With one extra line of code you get the same functionality w/o using undocumented features.
>>
>>You are right of course, about mistrusting undocumented features.
>>
>>However, I like the elegant simplicity of working with arrays. Looping through an array is somewhat easier (for instance, to set all CheckBoxes to true).
>>
>>And with an additional array, it seems to me that the array has to be set to NULL before releasing the form.
>>
>>Nothing extremely complicated perhaps, but I thought that my solution was simpler. I am not sure now.
>>
>
>Hilmar,
>
>Maybe I'm missing something but I don't see any additional arrays in my solution. It uses the same array as yours.

Additional, that is, to the original name.

Thus we would have:
Options1
Options2
Options3

And the array:

ThisForm.aOptions(1..3)
I assume that closing the form without NULL-ing the array first would cause a dangling reference.

IAC, your alternative might be more flexible, especially for the purposes of Len Speed (removing individual objects).

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform