On 2011-02-11, at 10:28, André Bargull wrote:

>> 
>> + <para>The debugger can be used to define global variables. Use the 
>> <literal>var</literal>
>> +        keyword to define a new global variable. For example, after 
>> evaluating <literal>var
>> +        n=100</literal>, evaluating <literal>n+1</literal> will print the 
>> value
>> + <literal>101</literal>.</para>
>> +
>> + <note>
>> + <para>The <literal>var</literal> keyword is only necessary to define 
>> <emphasis role="em"
>> + >new</emphasis> global variables. You do not need it to change the value 
>> of existing
>> +          variables. For example, after evaluating <literal>var 
>> n=100</literal>, you can evaluate
>> + <literal>n=200</literal> to change the value of <varname>n</varname>. You 
>> do not need to
>> +          evaluate <literal>var n=200</literal> (although the extra 
>> <literal>var</literal> is
>> +          harmless.)</para>
>> + </note>
>> +
>> + <para>You can also use <literal>var</literal> to create new global 
>> functions. <literal>var f =
>> +          function (x) {return x+1}</literal> creates a new function named 
>> <varname>f</varname>,
>> +        which can be used in subsequent expressions such as 
>> <literal>f(1)</literal>.</para>
> 
> 
> Global variables won't be created for swf9 or later. We also actually want to 
> change this behaviour (LPP-8520). Therefore I'd propose to comment out all 
> three paragraphs for now. The next section "Functions and Expressions" needs 
> to be updated for swf9+ reality as well. Tucker should comment on this 
> topic...

Agree.  And even when we do fix 8520, you are not going to be able to use the 
debugger to create _new_ global bindings.  (And there is really no reason you 
would want/need to.)  The most you will be able to do is create new bindings in 
the debug evaluation environment, essentially as temporary variables.  In the 
interim, there are `_`, `__`, and `___` that remember the value of the last 3 
expressions you evaluated in the debugger.

>> + <note>
>> + <para>The <literal>&lt;canvas compileroptions= "..."</literal> ensures that
>> +              backtraces are on for this example. This option is only 
>> available in OpenLaszlo
>> +              revisions 4.2.1 and later. Backtraces can also be enabled in 
>> the Developer Toolbar,
>> +              which is what you would normally do. In general, you would 
>> not deploy an application
>> +              with backtraces on as they impact the performance of the 
>> application significantly.
>> +              Backtraces are currently only available in SWF8 and DHTML 
>> runtimes.</para>
>> + </note>
> 
> "backtrace" doesn't work for swf9+? Is that right Tucker?

Backtraces work on all platforms.  Even if they did not, I would not document 
this in an overview document like this, but rather in some exception or bug 
list.

Reply via email to