Script Steps Reference
Table Of Contents
- Chapter 1 Introduction
- Chapter 2 Control script steps
- Chapter 3 Navigation script steps
- Chapter 4 Editing script steps
- Chapter 5 Fields script steps
- Set Field
- Set Next Serial Value
- Insert Text
- Insert Calculated Result
- Insert From Index
- Insert From Last Visited
- Insert Current Date
- Insert Current Time
- Insert Current User Name
- Insert Picture
- Insert QuickTime
- Insert Object (Windows)
- Insert File
- Update Link (Windows)
- Replace Field Contents
- Relookup Field Contents
- Export Field Contents
- Chapter 6 Records script steps
- Chapter 7 Found Sets script steps
- Chapter 8 Windows script steps
- Chapter 9 Files script steps
- Chapter 10 Accounts script steps
- Chapter 11 Spelling script steps
- Chapter 12 Open Menu Item script steps
- Chapter 13 Miscellaneous script steps
- Appendix A Glossary
Chapter 2
|
Control script steps 21
Description
Evaluates a Boolean calculation and performs a conditional action based on that
evaluation. If the calculation result is any number except zero, the calculation evaluates
to True and the subsequent script steps are executed. If the calculation result is zero, no
data, or does not resolve into a number, then the calculation evaluates to False and the
subsequent script steps are not executed.
Every If step must have a corresponding End If script step on page 23 somewhere after
the If step and at the same indentation. Whenever you use an If script step, ScriptMaker™
automatically enters an End If step.
You can also add additional conditions by using the Else If script step on page 21 and Else
script step on page 22.
Note If you do not specify a calculation or if the calculation is unsuccessful, it will evaluate
as False. Use the Get(LastError) function to capture these errors.
Example
If [Get (AccountName) = "Jim Davis"]
Go to Layout [“File One”]
Perform Find [Restore]
End If
Else If
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 on page 20, 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 on page 22.
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.