Macro substitution


Author
Message
Keith Chisarik
Keith Chisarik
StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
As a VFP developer, the one thing I have missed the most of my old friend "&".

Trying to build controls and/or objects dynamically then loop through them has proven a real PITA, the closest I have come so far is using .NET's control arrays (not even as easy to use as VB6's, but I digress) which have the limitiation of having to be loaded.

So.... being former VFP developers did you put in anything like this?

for x = 1 to n 

l_controlstring = "thisform.txtTextbox" + alltrim(str(n)) + ".backcolor = rgb(255,213,202)"

&l_controlstring

next x

If you did, I'm sold.

Keith Chisarik

Replies
Keith Chisarik
Keith Chisarik
StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
I found this out on the net somewhere and the light went on:

       For i As Integer = 1 To 3
            CType(Me.Controls("Label" & i), Label).Text = "Text Number " & i
        Next

I get it............. BigGrin

Keith Chisarik

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Good deal.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search