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 18:23:53
 
 
To
25/10/2005 16:51:32
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:
01062074
Views:
14
Would it be possible to build a separate control which has both the ResultLine and Textbox. Then your code would be something like
This.Parent.ResultLine.txtPatientNotes.Value =;
     This.Value + ALLTRIM(This.Parent.ResultLine.txtPatientNotes.Value)
>Hi
>
>I'm creating a form with many instances of two classes ResultLine1, 2, 3 etc and Textbox1, 2, 3 etc. A click in the textbox updates a field in the the resultline. So I'd like to have generic code in the textbox class to work in all the instances.
>
>So in principle, I have code like this which runs from a click event on the textbox to change a value in ResultLine.
>
>ThisForm.ResultLine1.txtPatientNotes.Value =
> ALLTRIM(This.Value) + ALLTRIM(ThisForm.ResultLine1.txtPatientNotes.Value)
>
>So having set the Tag in the textboxclass as 1,2 etc I have tried to write code like this
>
>("Thisform.ResultLine"+ALLTRIM(This.Tag)+".txtPatientNotes.Value") = ;
> ALLTRIM(This.Value) + EVALUATE(ALLTRIM("ThisForm.ResultLine"+ALLTRIM(This.tag)+".txtPatientNotes.Value"))
>
>The right hand side works but the left does not because it just leaves it as a character expression and doesn't believe it's an object property!
>
>How can I get it to behave?
>
>Thanks for any help
>
>Mike
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform