-
Notifications
You must be signed in to change notification settings - Fork 0
pts script syntax loop advanced
LOOP [FROM] table_data [NODATERANGE]
[WHERE where_clause[ {AND|OR} where_clause]]
[[REVERSE_]SORTBY field_data]
[ROW_COUNT $variable_name]
END_LOOP
where_clause is exactly as before, except that if you include it in brackets, you can put NOT in front to negate just that clause.
The original clause separator was the comma (,), which acted as an implicit AND. This is still perfectly valid, but you can now mix any combination of AND, OR and NOT, and by using brackets you can alter priorities.
By default, OR will be evaluated before AND. It is strongly recommended to put brackets around combinations to show the intended priority clearly. If you mix the comma and AND / OR / NOT (not recommended), everything between each comma will be treated as if it were inside brackets.
Example:
(Statement split over multiple physical lines for clarity only)
These commands will now execute if the congregation is your local one and the brother is not the one named. They will also execute if the talk number is 161 or higher (not less than or equal to 160).
LOOP FROM "Home Talks"
WHERE ("Congregation" IS "$LocalCong" AND “Brother” ISNOT “$strThisBrother”)
OR (NOT “Talk Number” ISLESSOREQUAL “160”)
(commands go inside LOOP)
END_LOOP
Copyright © 2002 - 2025 by Andrew Truckle. All Rights Reserved.
- Using Public Talks
- Main Application Menu
-
Database Ribbon Panel
- Assignments Editor
- Backup Database
- Check Talk Exchange
- Compact Database
- Convert Database
- Create Unassigned Date Entries
- Database Security
- Maintain Databases
- Purge Database
- Rearrange Dates
- Restore Database
- Help Ribbon Panel
-
Home Ribbon Panel
- Create a Report
-
Manage Custom Reports
- Editing Scripts
- Content Ribbon Panel
- System Ribbon Panel
- Script Command Syntax
-
Tutorials
- Using The Script Editor
-
How To Write Scripts
- Module 1 - The Basics
- Module 2 - Hello, World!
- Module 3 - Multiple Text Blocks
- Module 4 - It's A Date, Then
- Module 5 - Oh, I'm Blushing!
- Module 6 - It is a Rainbow!
- Module 7 - The Font Of All Knowledge
- Module 8 - Queue To The Right
- Module 9 - Memory Like An Elephant
- Module 10 - May I Squeeze In There?
- Module 11 - Move Over, Please
- Module 12 - You Move Over Here
- Module 13 - Is My Back A Funny Colour?
- Module 14 - I'm Going Loopy Here!
- Module 15 - Fields Of Golden... Text
- Module 16 - Man, That Looks Weird
- Module 17 - Inner Peace, Inner Loop
- Advanced Script Features
- Quick Access Toolbar
- Settings Ribbon Panel
- Tools Ribbon Panel
- Revision History
- Contact Information