This AI is still in early stages of development.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Message output handler.

 

Syntax

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:

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

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

Availability

This feature requires:

  • Util.js v0.8 and above

See also

Related articles:

Related APIs:

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

 

  • No labels