SetCustomOutput — Installs function for redirecting script output
void SetCustomOutput( | outputFunction); |
| string | outputFunction; |
This method can be used to install a custom "callback" output: after this call, when the print command (or $$ or $$...$$ commands) are invoked the function "outputFunction" is called instead of the simple "print".
The custom function must have the following prototype:
function void myFunc(string text)
and remains installed only during the current script
Parameters
the name of the custom function
Example:
function void PrintRed(string text)
{
print('<font color="red">')
print(text)
print('</font>')
}
curScript.SetCustomOutput("PrintRed")
the above code causes all output strings to be printed in red text color.
To reinstall the default output function ("print") call the method SetStandardOutput