This version is out of date, covering development from v4.6.0 to v4.7.1. It is maintained here only for inbound reference links from elsewhere.
Jump to the current version of aTbRef.
|A Tinderbox Reference File : Objects & Concepts : Basic Comparison Operators||aTbRef Site Map|
Basic Comparison Operators
Queries support 6 basic comparison operators:
Comparing date (data type values) with the == and != operators. Agents regard two dates as being equal if they share the same year, month, and day — regardless of the time of day. This makes useful agent expressions that use the == equality operator. In early releases, equality looked only for identical time stamps, which was rarely what users expected.
For all other date comparisons, the time element of date-time attribute value is taken into account. Where no explicit time is set, the time defaults to '00:00'.
Note that the comparison operators >, >=, < and <= continue to compare both date and time. It is possible, for example, for the same note to be discovered by two agents with different query operators, one that locates $TheDate < today and another that searches for $TheDate == today. If the $TheDate has a time of 14:30 and today has a time of 11:00 then both queries will match; the first matches simple on a time agnostic whole-day basis, the second matches because 14:40 is later (greater) than 11:00.
The date parser accepts the following expressions as placeholders for calculated dates:
There is a further special case:
Day placeholders Sunday, Monday, etc., may be used. Tinderbox recognises the day of the week (in English, currently) and interprets it as the day after today with that week day. Thus on Sunday June 1, the date "Sunday" refers to Sunday, June 8.
In other respects, days of the week act like today and can be modified similarly, e.g. "Monday - 1 week" evaluates as the previous Monday.
Parentheses (rounded brackets) can be used to indicate a hierarchy of resolution:
($Cost > (450 * $Margin)) & ($Priority == "High")
The code in parentheses is resolved before the '&' join is made.
Agent query comparison operations will accept expressions on their right-hand side. This is legal syntax:
|Up: Objects & Concepts|
|Previous: Coding conventions|
Licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
[See aTbRef CC licence Attribution/Waiver info info]