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

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

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

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











Using the If Command


Once you've figured out what kind of conditional step you need, you create the script in ScriptMaker. The syntax for a simple If statement to print a statement isn't much more complex than plain English.

To use the If command step



1 .Choose Scripts > ScriptMaker (Control+Shift+S/Command+Shift+S). When the Define Scripts dialog box appears, click New.

2 .When the Edit Script dialog box appears, type a descriptive name for the script in the Script Name text box (in this case Account Balance).

3 .Under the Control category in the script step list on the left, double-click If (Figure 8.1).

Figure 8.1. Double-click If to add it to the script-assembly list.


[View full size image]

When you add If to a script, you'll see two lines in the script steps: If and End If (Figure 8.2). End If is added by default every time you choose If to mark the place in the script where the If steps end. Everything you want in your If statement must be placed between If and End If.

Figure 8.2. When you add an If step to a script, the End If is added automatically.


Chapter 4, "Calculation Fields").

5 .In the field list on the left, scroll to find your field (we use Balance Due). Double-click to add it to the formula box (Figure 8.3).

Figure 8.3. Choose the field you want the script to test in the If statement.


[View full size image]

6 .Choose the greater than (>) symbol from the Operators scrolling list by double- clicking it.

7 .Type 0 (zero), then click OK (Figure 8.4). The script-assembly list now displays the highlighted If statement with its condition (Figure 8.5).

Figure 8.4. Type 0 in the formula box.

Figure 8.5. Your conditional statement is added automatically to the If statement brackets.


[View full size image]

8 .

In the script step list on the left, double-click the action you want performed. We choose Perform Script, because we want to run a print statement script we've already created (Figure 8.6).

Figure 8.6. Steps inside If steps are indented.


Chapter 7, "Creating Simple Scripts.") Any script steps can be placed inside an If stepeven another If step.

9 .In Script Step Options, click the Specify button to bring up the "Specify Script" Options dialog box. In the scrolling list, double-click the script that you want performed if there's a balance due (Figure 8.7). Since you don't have anything else you want the script to do if there's no balance due, the If statement is finished.

Figure 8.7. This step runs the sub-script Print Statement.


10 .Click OK twice to close ScriptMaker.


Tip

You can just type a simple condition in the formula box for a statement, such as "Balance Due > 0". However, when you start creating more complicated scripts, or if your fields have long names, it's better to select field names and operators, as well as functions, from the scrolling lists. You must have a field that exactly matches what's in the conditional statement so that FileMaker can check its value. One of the hardest and most time-consuming aspects of scripts is that they frequently won't work right simply because you didn't catch a typing error.


/ 227