if then...end if

Examples


The if then...end if statement allows statements to be run on a conditional basis.

Syntax

if boolexp then statements {elseif boolexp then statements}{else statements} end if

Parameters

boolexp – Any expression that can be evaluated as true or false, such as:

A=B
Customer_Name = "John Smith" 
A+B<C

elseif boolexp then – If one or more of these clauses is included, and if the if clause has been evaluated as false, then the statements after the first elseif clause to be evaluated as true will be run.

else – If the else keyword is included, statements following it will be run if the if clause and all elseif clauses have been evaluated as false. Only one else can be included in an if then...end if statement.

statements – any valid sanScript statement or statements.


Documentation Feedback