Go to Contents
Previous
Page
Next
Page
Contents > Script steps reference (alphabetical list) > Control script steps > Else If script step

Else If script step
Format

Else If [<Boolean calculation>]
Options
Click Specify to define the Boolean calculation. In the Specify Calculation dialog box, type the calculation you want evaluated, or use the field list (on the left) and the functions list (on the right) with the mathematical and text operators to build the calculation.
Web compatibility
This script step is web-compatible.
Description
Like the If script step, Else If evaluates a Boolean calculation and performs a conditional action based on that evaluation. The Else If script step must follow an If step or another Else If step; it can't follow an Else script step.
When an If script step calculation evaluates to True (not zero), FileMaker Pro performs the steps that are indented under it. When an If script step evaluates to False (zero), script execution moves to any following Else Ifs as long as they evaluate to False. When an Else If statement evaluates to True, the block of steps under the Else If is executed. An evaluation of True ends the Else If process, and upon reaching the next Else If or Else statements, execution will skip ahead to End If.
Example

If [Get (AccountName) = "Jim Davis"]
   Go to Layout ["File One"]
   Perform Find [Restore]
Else If [Get (AccountName) = "Julia Vargas"]
   Go to Layout ["File Two"]
   Perform Find [Restore]
Else If [Get (AccountName) = "Gerard LeFranc"]
   Go to Layout ["File Three"]
   Perform Find [Restore]
Else
   Go to Layout ["File Four"]
   Show All Records
End If
Note   In this example, Get(AccountName) only returns usable values if database users log in using assigned account names. If no accounts are created or required, Get (AccountName) returns the default value `Admin'.
Related topics
Defining calculation fields
If function
If structure example
Script steps reference (alphabetical list)
Script step categories
About formulas

Contents > Script steps reference (alphabetical list) > Control script steps > Else If script step
Previous
Page
Next
Page