Skip to main content

Invoking a Class Method

Invoking a Class Method

To invoke a class method, the syntax is either of the following:

>Do ##class(Package.Class).Method(Args)
>Set localname = ##class(Package.Class).Method(Args)

It is also valid to use ##class as part of an expression, as in

 Write ##class(Class).Method(args)*2

without setting a variable equal to the return value.

A frequent use of this syntax is in the creation of new instances:

>Set LocalInstance = ##class(Package.Class).%New()

FeedbackOpens in a new tab