Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro Substitution in VB
Message
 
 
To
24/10/1998 01:37:41
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00150101
Message ID:
00150194
Views:
23
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform