If structure examples
If, Else If, Else, and End If script steps define a structure that controls whether or not script steps are performed. This control depends upon the result of a testable condition or Boolean calculation.
 •
 •
Else If steps provide additional Boolean tests. Else steps provide alternative steps to perform if all conditions evaluate to False.
Example 1 
Performs a find. If no records are found, displays a custom dialog. If records are found, sorts the found set.
Perform Find [Restore]
If [Get ( FoundCount ) = 0]
Show Custom Dialog ["Find Records"; "No records were found."]
Else
Sort Records [Restore; No dialog]
End If
Example 2 
Performs a find. If no records are found, displays a custom dialog. If one record is found, goes to the Invoice Details layout. If more than one record is found, goes to the Invoices layout.
Perform Find [Restore]
If [Get (FoundCount) = 0]
Show Custom Dialog ["Find Records"; "No record was found."]
Else If [Get (FoundCount) = 1]
Go to Layout ["Invoice Details"]
Else
Go to Layout ["Invoices"]
End If