Question
· Sep 13, 2020

How to handlle Variable Number of Parameters in Macro?

Common macro def as following

 

#def AnyNumber(%args) for i=1:1:$listlength(%args) { Write $listget(%args, i)}

Using this marcro in objectscript code:

ClassMethod Test() as %Status {

     $$$AnyNumber($lb(1,2,3))

}

if ths args is literal value , Iit worked great. But  When I want pass Objects, It's not working

$$$AnyNumber($lb(##class(someClass).%New()))

I know I can pass a %ListObjects , If I want more shorter Line. How can I do this.

Tks

Discussion (1)0
Log in or sign up to continue