Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stepping through field names myfield1, myfield2, myfield
Message
 
À
01/03/2000 12:01:33
Peter Brama
West Pointe Enterprises
Detroit, Michigan, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00339788
Message ID:
00339959
Vues:
15
>Ok
>
>I see how that works - that should work for the field names in the table ... but what about the corresponding
>button names on the form?
>
>Here is my code snippet the LONG way...
>
>MENU is the table name (I know, MENU is a reserved word ;-) )
>DESCx is the caption stored in the MENU table
>BUTNx is the button on the form
>
>
>if !isblank(menu.type1)
> thisform.butn1.enabled=.T.
> thisform.butn1.caption="\<1"+chr(13)+trim(menu.desc1)
>else
> thisform.butn1.enabled=.F.
> thisform.butn1.caption="\<1"
>endif
>
>if !isblank(menu.type2)
> thisform.butn2.enabled=.T.
> thisform.butn2.caption="\<2"+chr(13)+trim(menu.desc2)
>else
> thisform.butn2.enabled=.F.
> thisform.butn2.caption="\<2"
>endif
>
>if !isblank(menu.type3)
> thisform.butn3.enabled=.T.
> thisform.butn3.caption="\<3"+chr(13)+trim(menu.desc3)
>else
> thisform.butn3.enabled=.F.
> thisform.butn3.caption="\<3"
>endif
>
>if !isblank(menu.type4)
> thisform.butn4.enabled=.T.
> thisform.butn4.caption="\<4"+chr(13)+trim(menu.desc4)
>else
> thisform.butn4.enabled=.F.
> thisform.butn4.caption="\<4"
>endif
>
>
>
Pete

Could you use something like
* cButtonNumber is the number of the button
lcfield = "menu.type" + cButtonNumber
lobutton = EVALUATE("ThisForm.Butn" + cButtonNumber)
lobutton.caption = "\<" + cButtonNumber + ALLTRIM(&lcfield)
lobutton.enabled = NOT ISBLANK(&lcfield)
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform