Name

SetCustomOutput — Installs function for redirecting script output

Synopsis

void SetCustomOutput(outputFunction); 
string  outputFunction;

Description

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

outputFunction

the name of the custom function

See Also

GetCustomOutput, SetStandardOutput

Note

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