Antun’s Blog

Notes on OpenLaszlo, LZX and Rich Internet Application Development

Antun’s Blog header image 2

Use Commas to Separate Arguments to Debug.write()

August 21st, 2008 · No Comments

When you want to trace something to the Debugger in OpenLaszlo, you can call the Debug.write() method.

Often, you’ll want to write the value of something and a label, so that you can identify that output in the debugger, something like:

Debug.write("subviews: " + canvas.subviews);

However, it’s better to to get into a habit of use commas instead of a plus sign, like so:

Debug.write("subviews:", canvas.subviews);

Debug.write() takes an arbitrary number of arguments, which are comma-separated, and concatenates the output. If any of those arguments are complex objects (such as arrays, references to views, etc.) they’ll become links. If you click on them, you’ll be able to inspect the object itself. If you use the plus sign, then the JavaScript runtime will do the concatenation, and you’ll end up with a string; you won’t be able to click on the traced statement.

Tags: LZX Tips

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment