General information
Title:
Building up an object property name from strings ?
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only