Script Steps Reference
Table Of Contents
- Chapter 1 Introduction
- Chapter 2 Control script steps
- Chapter 3 Navigation script steps
- Chapter 4 Editing script steps
- Chapter 5 Fields script steps
- Set Field
- Set Next Serial Value
- Insert Text
- Insert Calculated Result
- Insert From Index
- Insert From Last Visited
- Insert Current Date
- Insert Current Time
- Insert Current User Name
- Insert Picture
- Insert QuickTime
- Insert Object (Windows)
- Insert File
- Update Link (Windows)
- Replace Field Contents
- Relookup Field Contents
- Export Field Contents
- Chapter 6 Records script steps
- Chapter 7 Found Sets script steps
- Chapter 8 Windows script steps
- Chapter 9 Files script steps
- Chapter 10 Accounts script steps
- Chapter 11 Spelling script steps
- Chapter 12 Open Menu Item script steps
- Chapter 13 Miscellaneous script steps
- Appendix A Glossary
23
Example
This example calculates a bonus for the top 10 sales agents based on their sales. The
script finds all records and sorts by a field called "Sales" (descending) to arrange the
agents by sales performance. The script starts at the first record and sets the loop counter
variable to 1 (in this example the loop counter field use is a number field with global
storage enabled -- this is the Count field in the example below). Then, the script calculates
the bonus as one quarter of the agent's salary. The script then goes to the next record and
exits the loop if the counter reaches 10. The loop counter increments by 1 and the loop
repeats.
Show All Records
Sort [Replace; No dialog]
Set Field [Table1::Count; 1]
Loop
Set Field [Table1::Bonus; Table1::Salary * .25]
Go to Record/Request/Page[Next]
Exit Loop If [Table1::Count = 10]
Set Field [Table1::Count; Table1::Count + 1]
End Loop
End Loop
Format
End Loop
Options
None.
Web compatibility
This script step is web-compatible.
Description
Marks the end of a Loop script structure. Whenever you use a Loop script step,
ScriptMakerâ„¢ automatically enters an End Loop step. The steps between Loop and End
Loop are automatically indented and the End Loop step is placed at the same indentation
level as its corresponding Loop step.
Example
Go to Record/Request/Page[First]
Loop
Set Field [Table1::Salary; Table1::Salary * 1.1]
Go to Record/Request/Page[Exit after last; Next]
End Loop