About Conditional Steps
Look closely at a simple, menu-driven script step. It's just a series of terse commands. "Go to this layout," "Find these records," or "Sort this file." The script has no contingency plan. Add a conditional step, and the script can ask the question "Under what condition should I perform this command?" More to the point, it can answer the question by examining the options you've provided.What makes a step conditional? That word of possibilities: if. In ScriptMaker, If is always followed by a condition. Conditions are very much what you might think they are: the situation under which the script can act. "If the account is based in Boston," "If the part is listed in inventory," and "If it's after March 31" are all examples of conditional statements. When the phrase following the If is true (it's a Boston account, the part is in inventory), the script will execute any commands that follow the If step. When the answer is no, the script may execute a different command or do nothing, depending on how you've structured the rest of the If command.If you don't add to the If, the script will end without doing anything. You can, however, add an Else step inside the If. FileMaker will do whatever follows the Else step if the answer to the If is negative.To figure out whether you need a simple If or an If combined with Else, write down what you'd like to have happen. For example, if you want a script to print a statement if there's a balance due in the account, you'd write:
Since there isn't anything you want to do as an alternative to printing, you need a simple If step.On the other hand, if you want a script to mark the Paid field with a Y or N depending on whether or not there's a balance due in the account, you'd write:
If there's a balance due,
Print a statement.
In this case, you have two different actions you want to take place when the script runs. Therefore, your If command will need an Else step inside it.
If there's a balance due Enter Y.
If there's not a balance due Enter N.
