-
Notifications
You must be signed in to change notification settings - Fork 0
pts script syntax if
END_IF marks the end of the set of commands to be executed once if the current row meets the specified criteria.
where_clause is of the form:
- field_data IS text_data
- field_data ISNOT text_data
- field_data CONTAINS text_data
- field_data STARTSWITH text_data
- field_data ENDSWITH text_data
- field_data ISLESS numeric_data (or date_data)
- field_data ISLESSOREQUAL numeric_data (or date_data)
- field_data ISMORE numeric_data (or date_data)
- field_data ISMOREOREQUAL numeric_data (or date_data)
- field_data ISMULTIPLEOF numeric_data
text_data is either a piece of literal text (* see below) to compare against (normal rules apply, see the TEXT command for details), or field_data. CURRENT and the dot are not required, as fields are always from the current loop row being examined (i.e., the one in progress before this IF command). Once again normal rules for field names apply (see the FIELD command for details).
NOT will examine the criteria for a match, and then do the opposite. Thus, a typical condition might be:
IF "Brother" ISNOT "J. Samuels"
IF NOT "Talk Number" ISLESS "1000".
Note that you can combine multiple condition clauses by separating with commas. All such clauses are applied to the current row to determine if it is acceptable, and if not, the contents of the IF are ignored. Any condition clauses that cannot be understood are ignored and no attempt is made to apply them to the current row (but any other clauses on the line are still checked).
Note also that you can embed inner loops and IFs within existing loops or Ifs, but for Ifs, the row being examined is always the current row from the innermost LOOP containing the IF.
Each IF must be matched by an END_IF, and all commands between those two commands will be executed if the current row matches the criteria.
field_data is exactly as for the FIELD command.
Unlike commands such as FONT, the keywords and parameters for the IF command, if supplied, must be supplied in the order shown. Condition clauses obviously can be in any order, though, within their section of the command.
text_data#8202;* The text value can also be a variable name, such as $variable. Also, it is important to use valid text if specifying literal text. Depending on the field type, you must follow this set of rules (not that you don't need to worry if you are creating the script through the editor).
| Text Field | Text fields have no limitations. Virtually any value is accepted. |
|---|---|
| Numeric Field | Number fields expect to be numeric. So only use numbers (0 to 9) |
| Tentative Field | Tentative field is actually a YES/NO field. Use: 0 for YES 1 for NO |
| Date Field | Date fields must follow a strict pattern: #YYYY MM DD# For example, given the date "January 4th, 1999", it would be represented with: #1999 01 04# |
Example:
IF "Chairman" IS "Chairman 1"
(commands go inside IF)
END_IF
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