Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Building up an object property name from strings ?
Message
 
To
25/10/2005 18:50:16
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:
01062091
Views:
14
This message has been marked as the solution to the initial question of the thread.
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
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform