Console.log: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
Line 29: Line 29:
|console.groupEnd() ||  
|console.groupEnd() ||  
|-
|-
|console.info(object [, object, ...]) ||  
|console.info(object [, object, ...]) || Same as console.log.
|-
|-
|console.log(object [, object, ...]) || Output a string or variable to the log.
|console.log(object [, object, ...]) || Output a string or variable to the log.
Line 37: Line 37:
|console.profileEnd() ||  
|console.profileEnd() ||  
|-
|-
|console.time(label) ||  
|console.time(label) || Starts a new timer with an associated label.
|-
|-
|console.timeEnd(label) ||  
|console.timeEnd(label) || Stops the timer with the specified label and prints the elapsed time.
|-
|-
|console.timeStamp([label]) ||  
|console.timeStamp([label]) || Puts an entry in the Debugger Timeline.
|-
|-
|console.trace() || Shows a stack trace. See what function you are coming from.
|console.trace() || Shows a stack trace. See what function you are coming from.

Revision as of 10:51, 8 October 2013

console.log(message)

Description

Console.log outputs text to the debugger's console. If you run your app with the debugger's console window open, you can see the message as your program runs. This is useful for tracing program execution, checking variable's value during execution and for timing.

Here are related console commands:

console.assert(expression, object)
console.clear()
console.count(label)
console.debug(object [, object, ...])
console.dir(object)
console.dirxml(object)
console.error(object [, object, ...])
console.group(object[, object, ...])
console.groupCollapsed(object[, object, ...])
console.groupEnd()
console.info(object [, object, ...]) Same as console.log.
console.log(object [, object, ...]) Output a string or variable to the log.
console.profile([label])
console.profileEnd()
console.time(label) Starts a new timer with an associated label.
console.timeEnd(label) Stops the timer with the specified label and prints the elapsed time.
console.timeStamp([label]) Puts an entry in the Debugger Timeline.
console.trace() Shows a stack trace. See what function you are coming from.
console.warn(object [, object, ...])

Example (Basic)

Rem console.log

ChangeForm(Form2)             
'go to next form without transition

Function Form1_onhide()
  MsgBox "Old Form Hidden"
End Function

Function Form2_onshow()
  Msgbox "Show form " & NSBCurrentForm.id
End Function

Example (JavaScript)

//ChangeForm sample call

ChangeForm(Form2);
//go to next form without transition

Form1.onhide = function() {
  alert("Old Form Hidden");
}

Form2.onshow = function() {
  alert("Show form " +  NSBCurrentForm.id);
}

Output

(msgbox showing "Old Form Hidden")

(msgbox showing "Show form Form2")

Related Items

Form