Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

Message output handler.

 

Syntax

Code Block
themeRDark
languagejavascript
linenumberstrue
uOut(sMsg_aMsg, oSelf, cOut);

Parameters

ParameterTypeMandatoryDescriptionUtil.js version
sMsg_aMsg

String

Array of String

(tick)

The message to output – either a single string or an array of strings.

0.8
oSelfSelf Descriptor Object(error)

Optional descriptor object, used to create a prefix to the message before it is output.

Example object: {file: "foo.js", ver: 1.2}

0.8
cOutConstant(error)

Constant defining desired output destination:

Child pages (Children Display)
excerpttrue

Default: OUT_DEFAULT

0.8

Return value

The return value of the output method will be returned (see documentation for OUT_* constants above for more information).

Example

Code Block
themeRDark
languagejavascript
titleOutput single line of text to console
linenumberstrue
var self = {file: "foo.js", ver: 1.2};
 
function bar() {
  uOut("bar() called", self, OUT_CONSOLE);
}
 
bar(); // "[foo.js v1.2] bar() called"
Code Block
themeRDark
languagejavascript
titleMulti-line output
linenumberstrue
function foo() {
  var names = ["bob", "jim", "kate"];
  uOut(names);
}
 
foo(); // outputs each of the names on a new line to OUT_DEFAULT
Div
classbox

Availability

This feature requires:

  • Util.js v0.8 and above
Div
classbox

See also

Related articles:

Related APIs:

  • Chat API – allows scripts to define chat commands and conversations.
  • Diag API – allows scripts to provide diagnostic routines.