Script-side test for function existence before calling ?
by Orion Elenzil · in Torque Game Engine · 07/24/2007 (1:46 pm) · 3 replies
Hey folks,
does anyone know of a way in torquescript to test for the existence of a function ?
it's okay to just go ahead and call() or exec() it,
but if the function doesn't exist it prints a warning to the console,
which is a *good* thing,
except in this case i know ahead of time that the function may not exist.
or any suggestions where to start writing such a ConsoleFunction.
tia,
orion
does anyone know of a way in torquescript to test for the existence of a function ?
it's okay to just go ahead and call() or exec() it,
but if the function doesn't exist it prints a warning to the console,
which is a *good* thing,
except in this case i know ahead of time that the function may not exist.
or any suggestions where to start writing such a ConsoleFunction.
tia,
orion
About the author
#2
for the curious, to expose that guy to script,
add the following to consoleFunctions.cc, near "ConsoleFunction(call...":
07/24/2007 (2:23 pm)
Thanks Simon.for the curious, to expose that guy to script,
add the following to consoleFunctions.cc, near "ConsoleFunction(call...":
ConsoleFunction(isFunction, bool, 2, 2, "isFunction(funcName)")
{
return Con::isFunction(argv[1]);
}
#3
heh.
07/24/2007 (2:27 pm)
Ah wait - that must be already included in something more recent than tge 1.3..heh.
Torque Owner CdnGater
Duggan Software Studio