Disable Script Steps

The Set Next Step button (Section 19.2) lets you skip script steps manually, but it's not much help unless you remember to click it at the right time. Instead, FileMaker Advanced lets you specify which steps you want to disable whenever the script runs. For example, looping scripts can take a long time to run in large databases, so temporarily disable your Loop and End Loop steps while you're checking other parts of the script. After one loop, the script continues on its merry way so you can continue debugging. (See the box on Section 19.1.1.5 for another cool way to get out of a loop.) You should also disable script steps that may do something destructive to your datarelying on Set Next Step and your mouse button is leaving an awful lot to chance.

To disable a script step (see Figure 19-5), open the script in ScriptMaker, then highlight the step you want to disable. Click the Disable button in the Edit Script dialog box. FileMaker puts two slashes in front of disabled script steps so you can identify them. To enable a step again, select it. The Disable button changes to Enable; click it and the step is back in business.

Figure 19-5. The last Perform Script step, which is highlighted, is disabled in this illustration. When a disabled script step is highlighted the Disable button reads "Enable." You need FileMaker Advanced and script editing privileges to enable or disable a script step.

Disabling script steps is useful for debugging, but it can have long-term use, too. Any step that you disable in FileMaker Advanced gets skipped whenever someone runs iteven in FileMaker Pro. So say your company has a semi-regular promotion, that creates discounts for a limited period.

You don't have to write two different scripts, one with the discount and one without, and then worry about some kind of test to make them available on a button or in the script menu at the proper times. Write one script, making sure the discount creation steps are separate from the main process. Then you can enable the pertinent steps when the promotion starts and disable them when it's over, with very little fuss or muss.

Part I: Introduction to FileMaker Pro

Your First Database

Organizing and Editing Records

Building a New Database

Part II: Layout Basics

Layout Basics

Creating Layouts

Advanced Layouts and Reports

Part III: Multiple Tables and Relationships

Multiple Tables and Relationships

Advanced Relationship Techniques

Part IV: Calculations

Introduction to Calculations

Calculations and Data Types

Advanced Calculations

Extending Calculations

Part V: Scripting

Scripting Basics

Script Steps

Advanced Scripting

Part VI: Security and Integration

Security

Exporting and Importing

Sharing Your Database

Developer Utilities

Part VII: Appendixes

Appendix A. Getting Help

show all menu





FileMaker Pro 8. The Missing Manual
FileMaker Pro 8: The Missing Manual
ISBN: 0596005792
EAN: 2147483647
Year: 2004
Pages: 176
Similar book on Amazon

Flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net