VISUAL QUICKPRO GUIDE FileMaker Pro 7 Advanced FOR WINDOWS AND MACINTOSH [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

VISUAL QUICKPRO GUIDE FileMaker Pro 7 Advanced FOR WINDOWS AND MACINTOSH [Electronic resources] - نسخه متنی

Cynthia L. Baron, Daniel Peck

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید











Debugging Scripts


Debugging is the process of figuring out what the error message you're getting actually means, how it relates to what you've done in your script, and what you need to do to correct it. Although an error capture script (see "Creating an Error Trap Script" later in this chapter) can help you with the first step, you have to apply that knowledge to your specific situation.

In addition, not all script problems generate error codes. Everything in the script can be technically correct (no missing fields, no endless loops, no problem sorts) and still not do what you want it to do. When that happens, you need to debug the script from scratch.

There are three major places to check when a script goes wrong:

The Specify options.
The easiest error to make is forgetting to set sort, find, or print options in the Script Step Options section. Checking these options is the first debugging step if you have no error codes but your script doesn't give you the records you expect.

Step order.
It's easy to add a step in the wrong place, particularly if you're adapting an existing script. Using the Pause Script, Halt Script, and Exit Script steps, you can stop a script at any stage to isolate the problem.

Pause Script stops everything until you click Continue or Cancel in the status area. You can set several Pause Script steps in strategic places in a long script to help you figure out where to concentrate your debugging efforts. The Exit step stops the running script. This helps you figure out whether your problems are in the main script or are really based in the sub-script it uses. The Halt step brings all scripts to an end at whatever point you place it. Halt is particularly useful for troubleshooting loops.

Conditional statements.
Even expert scripters occasionally put the item they want as the Else condition into the If step instead. When you have a nested If script (one If step inside another), it's all too easy to get confused. An error trap script is particularly useful in trouble shooting an If statement.


To use the Halt, Pause, or Exit Script commands



1 .Choose Scripts > ScriptMaker (Control+Shift+S/Command+Shift+S).

2 .Double-click the script you want to check. Our example, Export by Payment, has many sub-scripts, and we want to check which one is causing problems.

3 .In the script-assembly list in the Script Definition dialog box, click to select the step that you want to check. In our example, it's Export Checks (Figure 10.14).

Figure 10.14. Highlight the script step you want to check.


4 .Double-click Halt Script in the step list on the left (Figure 10.15). Click OK twice.

Figure 10.15. The Halt command will stop all running scripts wherever you place it.


5 .In the Define Scripts dialog box, click Perform to run the script.

The script will end where you inserted the Halt step. Check the conditions at that point to see if there is a problem.

6 .

Choose Scripts > ScriptMaker (Control+Shift+S/Command+Shift+S) and return to the Edit Script dialog box to make any changes.

7 .Repeat steps 5 and 6 until your script runs perfectly.

8 .When you're finished, return to the Edit Script dialog box. Click the Halt step that you inserted. Click Clear (Figure 10.16). Click OK twice.

Figure 10.16. After you've debugged the script, remove the Halt step.


[View full size image]



/ 227