-
Notifications
You must be signed in to change notification settings - Fork 0
pts script syntax field
field_data is a piece of text interpreted in exactly the same way as for a TEXT command (see the TEXT command, and the section Literal Text, Variables & Quotes). The difference is that the resulting piece of text must represent a valid field in the current database row. If it does not, "<ERROR>" is shown. If there is no loop currently in effect, and thus no current database row, then it also shows as "<ERROR>".
SHORTDATE_FIELD and LONGDATE_FIELD work the same as FIELD, but in addition they interpret the text retrieved as a date in your PC's short or long date format.
CUSTOMDATE_FIELD additionally requires a format_string. This determines how the date will be displayed in the report. Please see the custom date format string help topic for details of this. If you just use FIELD to pull out a date field from the database, it will be shown in the database's natural format.
The field name supplied for CUSTOMDATE_FIELD -must- be in speech marks, as must the format string. This is in contrast to the field name as specified for the other FIELD commands, which does not need to be in speech marks. If you fail to put the speech marks, the parser will not understand and the output will be undefined.
TIME_FIELD works the same as FIELD, but in addition it interprets the text retrieved as a time using the format specified in the application General preferences. This will either be 12 hour (the default) or a custom format. You should only use this script command for fields that hold the meeting time as a text string.
VARIABLE_FIELD assigns the value of the field to an existing variable. Thus the variable value will change with each iteration of the LOOP. However it does mean that you can now use any given field value elsewhere in your report.
All variables must be already declared using the REQUIRES command. You can add a hash # after the variable name with a format string to get the parser to fill the variable in a certain way. Here are the possible alternatives:
| $VariableName | This will save the contents of the variable in it's raw state with no additional formatting. |
|---|---|
| $VariableName#TIME | This will format the variable value as a "Time" field, taking into account application General preferences. |
| $VariableName#TALK_THEME | This will format the variable value as a "Talk Theme". You should use this with "Talk Number" fields. |
| $VariableName#SHORTDATE | This will format the variable value as a short date. |
| $VariableValue#LONGDATE | This will format the variable as a long date. |
| $VariableName#CUSTOMDATE[format_string] | This will format the variable using your specified format string. Please see the custom date format string help topic for details of this. |
| $VariableName#COUNT | This will format the variable with the count of characters in the field if it is of string type, or '-1'. Note that for integer field types, if used this will produce the count of characters in the number. |
| $VariableName#TTCOUNT | This will format the variable with the count of characters in the field after interpreting it as a talk theme title. Note that since #TALK_THEME is normally used to format a talk number into a talk theme title, #TTCOUNT replaces #COUNT for talk numbers to correctly get the count of characters in the title. |
Examples:
FIELD "Chairman"
SHORTDATE_FIELD "Last Given"
LONGDATE_FIELD "Last Given"
CUSTOMDATE_FIELD "Last Given" "%B %y"
TIME_FIELD "Time"
VARIABLE_FIELD "$RowNumber" "$NumberOfHomeTalks"
VARIABLE_FIELD "Speaker" "$VisitingSpeaker"
VARIABLE_FIELD "Last Given" "$varLastGiven#LONGDATE"
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