if then...end if


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


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


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

Customer_Name = "John Smith" 

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