Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Macro Substitution in VB
Message
 
 
À
24/10/1998 01:37:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00150101
Message ID:
00150194
Vues:
24
FWIW, you don't have to use macro expansion in VFP for this either. Look at the SetAll() method, and the Controls[] collection. You can also use eval()
for i = 1 to 10
   lcName = "thisform.text" + alltrim( str(i) )
   loObject = eval( lcName )
   with loObject
      .Enabled = .t.
   endwith
endfor
I don't use VB but I do think it has a Controls[] collection like VFP does.

>I am a VFP developer and need to do something in VB. In VFP, doing the following is routine business:
>
>for i = 1 to 10
> cBox = 'text' + alltrim(str(i))
> thisform.&cBox..enabled = .t.
>next
>
>The ampersand is Macro Substitution.
>
>How to do it in VB??
>
>I posted this in the VB Forum but got negative replies. Everybody said could not be done in VB.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform