TorqueScript Reference

- Main Page
- Related Pages
- Modules
- Classes

Functions
Console Output
Function Categories

## 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

void Assert | ( | condition | ,
|  | message |
| ) |  |

Fatal Script Assertion

Parameters

  condition | if false, exit the program
  message | message to print on assertion

void cls | ( |  | ) |

Use the cls function to clear the console output.

Returns
  No return value

String collapseEscape | ( | text |  | ) |

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

Parameters

  text | A string, possibly containing escape sequences.

Returns
  Returns a copy of text with all escape sequences converted to an encoding.

See also
  expandEscape

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

  dumpScript | Specifies whether or not classes defined in script should be dumped.
  dumpEngine | Specifies whether or not classes defined in the engine should be dumped.

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

  dumpScript | Specifies whether or not functions defined in script should be dumped.
  dumpEngine | Specifies whether or not functions defined in the engine should be dumped.

See also
  dumpConsoleMethods

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

Use the echo function to print messages to the console.

Parameters

  text | Any valid text string.
  ... | Any additional valid text string(s).

Returns
  No return value.

See also
  error, warn

void echoSeparator | ( |  | ) |

Prints a separator to the console.

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

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

Parameters

  text | Any valid text string.
  ... | Any additional valid text string(s).

Returns
  No return value.

See also
  echo, warn

String expandEscape | ( | text |  | ) |

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

Parameters

  text | A string, possibly containing escape sequences.

Returns
  Returns a copy of text with all escape sequences expanded.

See also
  collapseEscape

void gotoWebPage | ( | address |  | ) |

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

void quit | ( |  | ) |

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

Returns
  No return value

void quitWithErrorMessage | ( | msg | string | ) |

quitWithErrorMessage(msg)

- Quit, showing the provided error message. This is equivalent to an AssertISV.
  Parameters

    Error | Message

  Returns
    No return value

void sbmDumpStats | ( |  | ) |

void sbmDumpStrings | ( |  | ) |

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

  enable | A boolean value. If this value is true, extra information will be dumped to the console when files are loaded.

Returns
  No return value.

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

  mode | A bitmask enabling various types of logging. See 'Logging Modes' table below.

Returns
  No return value.

See also
  intputLog

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

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

Parameters

  text | Any valid text string.
  ... | Any additional valid text string(s).

Returns
  No return value.

See also
  warn, error