If

Syntax:
If <Logical expression> Then
// Operators
[ElsIf <Logical expression> Then]
// Operators
[Else]
// Operators
EndIf;

Parameters:
<Logical expression>
A logical expression.

Then
Operators following Then are executed if the result of the logical expression is True.

// Operators
One or several operators that are executed.

ElsIf
A logical expression following ElsIf is only calculated when all of the conditions in the If clause and all preceding ElsIf clauses are False.
Operators following ElseIf ... Then are only executed when the result of the logical expression in this clause is True.

Else
Operators following Else are executed when all of the conditions in the If clause and all preceding ElsIf clauses are False.

EndIf
Denotes the end of the conditional execution structure.

Description:
The If operator allows or denies script execution based on the result of one or several logical expressions. The operator can contain any number of operator groups enclosed in the ElseIf ... Then keywords.


    

1C:Enterprise Developer's Community