Filemaker Pro Lesson
Script Writing:
Using Loops and Conditional Statements
This exercise requires the file Registrations3.fp7.
Using a combination of loops and conditional statements to identify the attributes of a particular record and perform actions on it is a very powerful script function.
1. Select Scriptmaker. Create a script named "Form Letter Test".
2. Double click on the action "Enter Browse Mode". Then double click on the action Show All and Sort. Click Specify and sort by Last Name.
3. Double click on the action "Go To Record/Request/Page" and select the "First" option.
4. Double click on the action "If", click specify and enter Past Participant = "Yes" in the specify calculation dialog box.
5. Double click the action "Go to Layout" and select the layout "Past Participant Form Letter" from the drop down list. Note: Now with Filemaker Pro 7, we can also use a predefined Print script step, selecting the Print Current Record option. Previous versions of Filemaker Pro did not provide a way to store Print settings within a report script.
6. Double click the "Else" action
7. Double click the "Go to Layout" and select the layout "1st Time Form Letter".
8. Double click "Pause/Resume Script".
9. Double click on the action "Loop".
10. Double click "Go to Record/Request/Page" and select the "Next" option. Check the "Exit after last" checkbox.
11. Double click on the action "If", click specify and enter Past Participant = "Yes" in the specify calculation dialog box.
12. Double click the action "Go to Layout" and select the layout "Past Participant Form Letter" from the drop down list.
13. Double click the "Else" action
14. Double click the "Go to Layout" and select the layout "1st Time Form Letter".
Filemaker has automatically added the step "End if". Note: for every "If" there must be a corresponding "End if". Filemaker has also automatically added the step "End Loop". For every "Loop" there must be a corresponding "End Loop".
15. Click OK then Perform to see the result.
If you have an RSS feed that
would be of interest
to faculty and students at the College of Education
please contact Mary Harrsch.
Last updated: 12/28/2004