Database Reference
In-Depth Information
the Current Window option in the Select Window script step to bring the script's window
forward.
Halt Script and Exit Script
Normally a script ends when its last step runs. But you can force a script to end early if you
want to. FileMaker actually has two script steps that end a script prematurely: Exit Script
and Halt Script . These two steps do exactly the same thing if you run a script yourself
manually. But if the current script was run by another script —via the Perform Script
step—then they do different things. The Exit Script step tells FileMaker to stop the cur-
rent script and then continue the script that ran it. Halt Script , on the other hand, causes all
script execution to stop immediately, no matter how the current script was started.
Exit Script (Result)
Exit Script has a powerful option that Halt Script doesn't have: a script result. With a
script result, you can tie all the power of the Specify Calculation window to Exit Script .
Then your main script can check the script result and decide how to proceed based on the
results of the test. For example, if your script doesn't find any invoices, it shouldn't try to
sort and then print an empty found set. An Exit Script step at the end of Find Unpaid In-
voices will help the Print Statements script figure out whether it should sort and print. Here's
how to add an Exit Script step to an existing script:
1. In the Manage Scripts window, double-click the Find Unpaid Invoices script .
The Exit Script step is always added to your subscript. The Edit Script window
opens.
2. In the script step list, double-click the Exit Script step .
The step is added to your list. If necessary, move it to the bottom of the list. (You
don't want the script stopping before all the work is done.)
3. Click the Specify button .
If you don't see the specify button, make sure the Exit Script step is still high-
lighted. The Specify Calculation window appears.
4. In the View pop-up menu, choose the Get(FoundCount) function. Or enter
Get(FoundCount) if you prefer .
The function appears in the calculation field. The script will record the number of un-
paid records it finds when it's done.
Search WWH ::




Custom Search