Respond to an unknown method call: Difference between revisions
Content added Content deleted
Line 1,258: | Line 1,258: | ||
=={{header|Ring}}== |
=={{header|Ring}}== |
||
<lang ring> |
<lang ring> |
||
new test { |
|||
check(:func1) check(:func2) |
|||
anyMethodThatDoesNotExist() |
|||
} |
|||
func func1 |
|||
? "Message from function: func1" |
|||
class test |
|||
func braceerror |
|||
func check cFuncName |
|||
if substr(cCatchError,"Error (R3)") |
|||
if isFunction(cFuncName) |
|||
? " |
? "You are calling a method that doesn't exist!" |
||
ok |
|||
else |
|||
? "Function " + cFuncName + " does not exist" |
|||
ok |
|||
</lang> |
</lang> |
||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
You are calling a method that doesn't exist! |
|||
Function func1 exists |
|||
Message from function: func1 |
|||
Function func2 does not exist |
|||
</pre> |
</pre> |
||