----- Douglas Garstang <[EMAIL PROTECTED]> wrote:
> context new_pbx_betty_start {
> 
>     _X. => { 
>         for (x=0; ${x} < 3; x=${x} + 1) { 
>             Verbose(x is ${x} !); 
>         }                  
>     }; 
> 
> }
> 
> Here's the output.
> 
> The var x never gets incremented! Is this a bug?
> The while loops seem to work ok.

I would have to see the output of "show dialplan new_pbx_betty_start" to know 
exactly what is going on.  However, I'm guessing that if you remove the space 
between the semicolon and the "x=${x} + 1", it will work.

On pretty much everything except expression evaluation (such as ${x} < 3), 
Asterisk is sensitive to whitespace.  " x=${x} + 1" was most likely translated 
directly into Set( x=$[${x} = 1]).  That means you are setting the variable 
name, " x", including the leading space.  That is not the same variable as ${x} 
which you are using everywhere else.

-- 
Russell Bryant
Software Developer
Digium, Inc.

_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to