update
This commit is contained in:
parent
1f1ad49427
commit
6f050a029e
2496 changed files with 37609 additions and 3031 deletions
|
|
@ -0,0 +1,33 @@
|
|||
Class DynamicDispatch.Example Extends %RegisteredObject
|
||||
{
|
||||
|
||||
Method Foo()
|
||||
{
|
||||
Write "This is foo", !
|
||||
}
|
||||
|
||||
Method Bar()
|
||||
{
|
||||
Write "This is bar", !
|
||||
}
|
||||
|
||||
Method %DispatchMethod(Method As %String, Args...)
|
||||
{
|
||||
Write "Tried to handle unknown method '"_Method_"'"
|
||||
For i=1:1:$Get(Args) {
|
||||
Write ", " If i=1 Write "with arguments: "
|
||||
Write "'"_Args(i)_"'"
|
||||
}
|
||||
Write !
|
||||
}
|
||||
|
||||
ClassMethod Test()
|
||||
{
|
||||
Set obj=##class(DynamicDispatch.Example).%New()
|
||||
Do obj.Foo()
|
||||
Do obj.Bar()
|
||||
Do obj.Grill()
|
||||
Do obj.Ding("Dong", 11)
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue