PDA

View Full Version : Using debug


javanaut
10-28-2003, 10:19 AM
The code snippet below from the documentation for the Redmond menu does not work. The menu widgets are displayed but clicking on a menu item does not produce any output in the debugger window. What's wrong with the snippet? I have seen debug.write() and Debug.Write(). Is the compiler case insensitive? Are there any notes on the debugger? Thanks in advance.

javanaut
10-28-2003, 10:26 AM
Sorry, I forgot to post the code snippet from your documentation:

<canvas debug="true">
<menubar width="200" height="25">
<menu label="Menu 1" hasbutton="true" width="100">
<menuitem label="Item 1" onclick="canvas.whichOne(this);"/>
<menuitem label="Item 2" onclick="canvas.whichOne(this);"/>
<menuitem label="Item 3" onclick="canvas.whichOne(this);"/>
<menuseparator/>
<menuitem label="Item 4" onclick="canvas.whichOne(this);"/>
</menu>
<menu label="Menu 2" hasbutton="true" width="100">
<menuitem label="More items..." onclick="canvas.whichOne(this);"/>
</menu>
</menubar>

<method name="whichOne" args="vThis">
debug.write(vThis.parent.label+" - "+vThis.label);
</method>
</canvas>

antun
10-28-2003, 10:49 AM
Thanks for pointing this out. I've filed a bug against the documentation content on this.

The example should read:


<canvas debug="true">
<menubar width="200" height="25">
<menu label="Menu 1" hasbutton="true" width="100">
<menuitem label="Item 1" command="cmd_1" />
<menuitem label="Item 2" command="cmd_2" />
<menuitem label="Item 3" command="cmd_3" />
<menuseparator/>
<menuitem label="Item 4" command="cmd_4" />
</menu>
<menu label="Menu 2" hasbutton="true" width="100">
<menuitem label="More items..." command="cmd_more_items" />
</menu>
</menubar>

<command id="cmd_1" onselect="debug.write( 'Command one' )" />
<command id="cmd_2" onselect="debug.write( 'Command two' )" />
<command id="cmd_3" onselect="debug.write( 'Command three' )" />
<command id="cmd_4" onselect="debug.write( 'Command four' )" />
<command id="cmd_more_items" onselect="debug.write( 'More items...' )" />
</canvas>


Is the compiler case insensitive?

You mean the run-time, not the compiler, right? No it's not case sensitive. You can do both debug.write adn Debug.Write, and I believe that both should work. However I would recommend treating it as case sensitive.

-Antun