just wondered if there was a way to pass functions for execution to another function so that events can occur before and after?
like :
d ..MethodA(
..Method1("var"),
..Method2(0),
...
)edit:
I managed to get it working with execute but is there a cleaner (easier way)?
ClassMethod WriteSegment(Functions... As %String) As %Status
{
w "Start",!
f Fn=1:1:Functions {
x Functions(Fn)
}
w "End",!
Q $$$OK
}
ClassMethod WriteSomething(Arg As %String) As %Status
{
w Arg,!
Q $$$OK
}
ClassMethod Testing() As %Status
{
d ..WriteSegment(
"d ..WriteSomething(""Hi"")",
"d ..WriteSomething(""Bye"")"
)
Q $$$OK
}