Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

if

 

Syntax

Release Information

Statement introduced in version 1.0 of the SLAX language.

Description

Include a conditional construct that causes instructions to be processed if the Boolean expression evaluates to TRUE.

Optionally, you can include multiple else if statements following an if statement to perform additional conditional tests if the expression in the if statement evaluates to FALSE. Multiple else if statements can be included, but the processor only executes the instructions contained in the first else if statement whose expression evaluates to TRUE; all subsequent else if statements are ignored. The optional else statement includes a default set of instructions that are processed if the expressions defined in all associated if and else if statements evaluate to FALSE.

Attributes

expressionSpecifies the expression to evaluate.

SLAX Example

XSLT Equivalent

Usage Examples

See Example: Configuring Dual Routing Engines, Example: Preventing Import of the Full Routing Table, and Example: Automatically Configuring Logical Interfaces and IP Addresses.