Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
For command
Message
De
27/07/2009 23:24:45
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01414931
Message ID:
01414963
Vues:
29
This message has been marked as a message which has helped to the initial question of the thread.
>I have several forms with many objects as below
>
> form1.object1.enabled = .F.
> form1.object2.enabled = .F.
> form1.object3.enabled = .F.
>... etc
>
>I need to enabled these properties using for command
>
>for myObj = 1 to 100 do
>
> "form1.object" +myObj + ".enabled = .T.
>
>endfor
>
>Sometimes a form can have 5 objects, others can have 20, 55 , etc
>
>How can I do to prevent errors with for command when and object does not exist ?

If you have several similar objects, you can actually create them as an array of objects in the first place. In FAQ #8110 I outline several alternatives, including this one - which several UT members find somewhat controversial, because it is an undocumented feature I believe.
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
Répondre
Fil
Voir

Click here to load this message in the networking platform