IF...ENDIF Statement  

Conditionally executes a group of statements, depending on the value of an expression.

If condition Then 

   [statements]

[Else]

   [elsestatements]

EndIf 

 

Arguments

condition           One or more of the following two types of expressions: A numeric or string expression that evaluates to True or False.

statements        One or more statements executed if condition is True.

elsestatements  One or more statements executed if condition is False.

 

Remarks

When executing an If , the condition is tested. If condition is True, the statements following Then are executed. If condition is False,  the statements following Else are executed. After executing the statements following Then or Else, execution continues with the statement following EndIf.

The Else clause is optional. If statements can be nested; that is, contained within one another. The If must end with an EndIf statement.

 

Example

If lop = 3 then

          End      

Else

          vLoop = vLoop + count   

EndIf