Send an unknown method call: Difference between revisions

added Caché ObjectScript
(lua again)
(added Caché ObjectScript)
Line 23:
}
</lang>
 
=={{header|Caché ObjectScript}}==
 
$METHOD executes a named instance method for a specified instance of a designated class.
 
<lang cos>Class Unknown.Example Extends %RegisteredObject
{
 
Method Foo()
{
Write "This is foo", !
}
 
Method Bar()
{
Write "This is bar", !
}
 
}</lang>
{{out|Examples}}
<pre>
USER>Set obj=##class(Unknown.Example).%New()
USER>Do $Method(obj, "Foo")
This is foo
USER>Do $Method(obj, "Bar")
This is bar
</pre>
 
=={{header|E}}==