Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Building up an object property name from strings ?
Message
From
25/10/2005 19:32:33
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01062046
Message ID:
01062095
Views:
10
>Mike,
>
>You can do both things this way:
>
>
>with evaluate("Thisform.ResultLine"+ALLTRIM(This.Tag)+".txtPatientNotes")
>   .Value = ALLTRIM(This.Value) + EVALUATE(ALLTRIM("ThisForm.ResultLine"+ALLTRIM(This.tag)+".txtPatientNotes.Value"))
>   .SetFocus()
>endwith
>
>
>You can replace all the strings more readable
>
>
>lcName = "Thisform.ResultLine"+ALLTRIM(This.Tag)+".txtPatientNotes"
>with evaluate(lcName)
>   .Value = alltrim(this.Value) + alltrim(.Value)
>   .SetFocus()
>endwith
>
I'd have used STORE for the Value assignment and macro substitution for the SetFocus. I like your way much better.
Previous
Reply
Map
View

Click here to load this message in the networking platform