How to Set Data in a Property from a Routine
Hello,
I am wondering if it is possible to access properties of a class from within a routine that has been called. See the below example:
Class TestClass Extends %RegisteredObject
{
Property Data As %ListOfDataTypes;
Method Query(parameter As %String)
{
d runTag^ExampleRoutine(parameter)
q
}
}
And then I have a routine:
ExampleRoutine
runTag(parameter)
;I want to add some information to the Data property in the class here.
q
Go to the original post written by @Colin Parker
Discussion (3)0
Comments
You can use the $THIS special variable. For example:
runTag(parameter)
set t = $THIS
do t.Data.Insert("abc")
w t.Data.GetAt(1)
q
Thank you. That works perfectly.
Why do you want to do that?