-
Notifications
You must be signed in to change notification settings - Fork 0
pts tutorial2 module15
(Continues on from the "Database" script - requires you to follow the previous section first)
| The following commands are used in this module: FIELD |
|---|
Notice how we had to issue an EOL after this FIELD, just like we do with TEXT? There's a good reason for that. The result of a FIELD command is text, just like the result of a TEXT command or even one of the DATE commands. Thus, just like a TEXT command, we can do alignments, tabs, colours, fonts, highlights... anything we can do with TEXT, we can also do with FIELD.
The difference is that the parameter to FIELD is not the actual text to display, but the name of a database field for the current row, and the text extracted from that field is what is displayed.
This is the key to getting data out of a database: using FIELD commands to replace literal text with database contents.
Notice I said current row. We already know that the LOOP command runs through all rows and gives them to us one at a time, and everything inside that LOOP / END_LOOP pair gets done for every single one of those rows. If a row was omitted from the loop somehow, then clearly those commands shouldn't be done on that missing row.
Since a FIELD is just a TEXT, we can happily mix TEXT and FIELD commands in the same physical line of output to build up our report. This is the remaining reason why we have this need to specify where the end of the physical line is; as well as possibly needing to mix colours, we will need to mix literal text with database contents without having to have broken lines everywhere.
Let's check that: Highlight the FIELD command for insertion before it. Insert a TEXT command using "This row's talk date is: " (no quotes). You should see this echoed on every single line in front of the dates now. |
|---|
It is important to try and get into a mindset: when you are looking at commands within a loop, remember that this is operating on a specific row at any one time, the current row. This will hopefully help later, when we get more complex loops.
| Now, please: Click Save Script Optionally click Close Script Then when you are ready, open the "Database" script and continue with module 16. |
|---|
| Previous Module | Next Module |
|---|
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
Let's check that: Highlight the FIELD command for insertion before it. Insert a TEXT command using "This row's talk date is: " (no quotes). You should see this echoed on every single line in front of the dates now.