TorqueScript Reference
Functions
Console Output

Functions

void Assert (condition, message)
 
void cls ()
 
String collapseEscape (text)
 
void dumpConsoleClasses (bool dumpScript=true, bool dumpEngine=true)
 
void dumpConsoleFunctions (bool dumpScript=true, bool dumpEngine=true)
 
void echo (text, [...] *)
 
void echoSeparator ()
 
void error (text, [...] *)
 
String expandEscape (text)
 
void gotoWebPage (address)
 
void quit ()
 
void quitWithErrorMessage (msg string)
 
void sbmDumpStats ()
 
void sbmDumpStrings ()
 
void setEchoFileLoads (enable)
 
void setLogMode (mode)
 
void warn (text, [...] *)
 

Detailed Description

Function Documentation

◆ Assert()

void Assert ( condition  ,
message   
)

Fatal Script Assertion

Parameters
conditionif false, exit the program
messagemessage to print on assertion

◆ cls()

void cls ( )

Use the cls function to clear the console output.

Returns
No return value

◆ collapseEscape()

String collapseEscape ( text  )

Use the collapseEscape function to replace all escape sequences ('xx') with a collapsed version ('xx').

Parameters
textA string, possibly containing escape sequences.
Returns
Returns a copy of text with all escape sequences converted to an encoding.
See also
expandEscape

◆ dumpConsoleClasses()

void dumpConsoleClasses ( bool  dumpScript = true,
bool  dumpEngine = true 
)

dumps all declared console classes to the console. This will dump all classes and methods that were registered from within the engine, AND from the console via scripts.

Parameters
dumpScriptSpecifies whether or not classes defined in script should be dumped.
dumpEngineSpecifies whether or not classes defined in the engine should be dumped.

◆ dumpConsoleFunctions()

void dumpConsoleFunctions ( bool  dumpScript = true,
bool  dumpEngine = true 
)

Dumps all declared console functions to the console. This will dump all funtions that were registered from within the engine, AND from the console via scripts.

Parameters
dumpScriptSpecifies whether or not functions defined in script should be dumped.
dumpEngineSpecifies whether or not functions defined in the engine should be dumped.
See also
dumpConsoleMethods

◆ echo()

void echo ( text  ,
[...] *   
)

Use the echo function to print messages to the console.

Parameters
textAny valid text string.
...Any additional valid text string(s).
Returns
No return value.
See also
error, warn

◆ echoSeparator()

void echoSeparator ( )

Prints a separator to the console.

◆ error()

void error ( text  ,
[...] *   
)

Use the error function to print error messages to the console. These messages usually print in red.

Parameters
textAny valid text string.
...Any additional valid text string(s).
Returns
No return value.
See also
echo, warn

◆ expandEscape()

String expandEscape ( text  )

Use the collapseEscape function to replace all escape sequences ('xx') with an expanded version ('xx').

Parameters
textA string, possibly containing escape sequences.
Returns
Returns a copy of text with all escape sequences expanded.
See also
collapseEscape

◆ gotoWebPage()

void gotoWebPage ( address  )

Open a URL in the user's favorite web browser.

◆ quit()

void quit ( )

Use the quit function to stop the engine and quit to the command line.

Returns
No return value

◆ quitWithErrorMessage()

void quitWithErrorMessage ( msg  string)

quitWithErrorMessage(msg)

  • Quit, showing the provided error message. This is equivalent to an AssertISV.
    Parameters
    ErrorMessage
    Returns
    No return value

◆ sbmDumpStats()

void sbmDumpStats ( )

◆ sbmDumpStrings()

void sbmDumpStrings ( )

◆ setEchoFileLoads()

void setEchoFileLoads ( enable  )

Use the setEchoFileLoads function to enable/disable echoing of file loads (to console). This does not completely disable message, but rather adds additional methods when echoing is set to true. File loads will always echo a compile statement if compiling is required, and an exec statement at all times

Parameters
enableA boolean value. If this value is true, extra information will be dumped to the console when files are loaded.
Returns
No return value.

◆ setLogMode()

void setLogMode ( mode  )

Use the setLogMode function to set the logging level based on bits that are set in the mode argument. This is a general debug method and should be used in all but release cases and perhaps even then.

Parameters
modeA bitmask enabling various types of logging. See 'Logging Modes' table below.
Returns
No return value.
See also
intputLog

◆ warn()

void warn ( text  ,
[...] *   
)

Use the warn function to print warning messages to the console. These messages usually yellow or orange.

Parameters
textAny valid text string.
...Any additional valid text string(s).
Returns
No return value.
See also
warn, error