Jump to content

Respond to an unknown method call: Difference between revisions

added Autohotkey
(added Autohotkey)
Line 5:
 
See also [[Send an unknown method call]].
 
=={{header|AutoHotkey}}==
<lang AutoHotkey>class example
{
foo()
{
Msgbox Called example.foo()
}
 
__Call(method, params*)
{
funcRef := Func(funcName := this.__class "." method)
if !IsObject(funcRef)
{
str := "Called undefined method " funcName "() with these parameters:"
for k,v in params
str .= "`n" v
Msgbox %str%
}
else
{
return funcRef.(this, params*)
}
}
}
 
ex := new example
ex.foo()
ex.bar(1,2)<lang>
 
=={{header|Brat}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.