In article <50390065.6020...@truemetal.org>,
Markus <unive...@truemetal.org> wrote:
> 
> Can anyone shed some light on:
> 
> 
> A few more questions - the doc link that I just mentioned shows:
> 
> GotoIf(condition?label1[[:label2])
> 
> What are the [[ before :label2? There are two opening square brackets, 
> but just one ] closing? Is that a typo?

Yes, it looks like a typo and should be [ instead of [[

These square brackets are not part of the syntax, but are just showing that
the colon and label2 are optional, so it means you can have either:

GotoIf(condition?label1:label2)

or:

GotoIf(condition?label1)

In the latter case, you branch to label1 if the condition is true, and just
continue with the next statement if it's false.

> Also, the doc shows:
> 
> GotoIf(condition?[label1]:label2)
> 
> Why is label1 in square brackets and label2 isn't?

This is saying that label1 is optional. If you only want to branch when
the condition is false, you say:

GotoIf(condition?:label2)

I guess it could easily have been confusing because typically the condition
is an expression contained within $[...], where the square brackets ARE part
of the syntax!

Hope this helps!

Cheers
Tony

-- 
Tony Mountifield
Work: t...@softins.co.uk - http://www.softins.co.uk
Play: t...@mountifield.org - http://tony.mountifield.org

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

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

Reply via email to