If( )

Parent Previous Next

If( )


An If expression allows a section of content to be included based on the result of a predicate, with an optional section of content to be included otherwise.


Syntax


If(Predicate)

{

<list of page level objects>

}

[ Else { <list of page level objects> } ]



Arguments

Predicate - Any valid predicate


list of page level objects - Any valid list of page level objects enclosed in {}.


Else - Follows an If() statement and the If() statement's list of page level objects. The Else statement defines an alternate set of commands to execute if the If() statement is not run. The Else argument along with it's list of page level objects is optional.


Examples


If(Any(RunSelector('widgets')))

{

Span('I will print if True');

}

Else

{

Span('Otherwise I will print');

}