Functions Index :: I :: IsCallable
Module:
Definition:
IsCallable(string func)
Description:
Returns true if its argument can be called (ie it is a function).
Be aware of possible side effects if the argument function modidies globals and can be called without arguments, since it is actually called in order to find if it is callable.
The function is a modification - to allow its use as a "silent" (ie not throwing any error) callability test - of stickboy's JDL_FunctionDefined, which on turn was based on the initial idea of mf for testing specific strings in Avisynth error messages in order to extract useful information (see the related thread in doom9 forum for details).
Examples:
function user_func(int x) { return 2*x-5 }
b1 = IsCallable("user_func") # b1 == true
b2 = IsCallable("notexist_func") # b2 == false