Run a cache expression stored in a variable
Hi All,
I have a class method, this can be any cache expression to execute (usually a class / method and args) and and args stored in a variable, for example;
set aa = "##Class(Utils.Test).Run(1,2,3)" do aa
I tried using $classmethod(class,method,args..), by extracting the values but sometimes there can be no arguments, or arguments such as ;
("2019-01-01","1,2,3,4")
which causes issues while running the $classmethod, (i am using $P to extract the Class, Method and args).
Is there any simpler way of doing this?
did you try xcute . Its used to execute strings .
thanks a mil, xecute worked
almost done
do @aa
But be aware that variables you pass to your method are either explicit as in your example
or are variables in global scope. eg. %par1, %par2, ...