Script Steps Reference

Table Of Contents
Control script steps
F
ILEMAKER SCRIPT STEPS REFERENCE 23
If
Purpose
Evaluates a Boolean calculation and performs a conditional action based on that evaluation.
Format
If [<Boolean calculation>]
Options
<Boolean calculation> specifies the calculation you want evaluated.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
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 somewhere after the If step and at the
same indentation. Whenever you use an If script step, the script editing pane automatically enters
an End If step.
You can also add additional conditions by using the Else If script step and Else script step.
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 1
Performs a find. If no records are found, displays all records and sorts.
Perform Find [Restore]
If [Get (FoundCount) = 0]
Show All Records
Sort Records [Restore; No dialog]
End If
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server scheduled script Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes