This topic covers the implementation details of TDateConditionsRec (see also TDateConditionsRec Values).
Scope: TypeDefinitions.pas; record. Prepared from the curated implementation supplied for this review on 2 October 2026.
Five strings encode selected conditions: Weekdays, Holidays, DaysOfMonth, Miscellaneous and MoonPhases. BoolType is Any=0 or All=1. This reader stores the strings and does not evaluate them.
The existing TDateConditionsRec Values help page defines individual character meanings. Grouping, empty-group truth behavior, duplicates, invalid characters and cross-group evaluation must be confirmed in the condition evaluator. Parent line-ending initializers set different defaults for TrueConditions and FalseConditions.
Notation and shared helper rules: Reading this reference.
Practical editing guide: Modifying GenTokens in an XML script.
Mapping the three-state condition editor
TpeSpecialCases.getConditionsFromForm collects checked controls into TrueConditions and unchecked controls into FalseConditions. Grayed/indeterminate controls are omitted from both. To make a condition irrelevant, remove its character from both groups. To move it from true to false, remove it from the first group and add it to the second; do not leave contradictory copies.
Each group’s BoolType is its combo index: 0=Any and 1=All. Weekdays are encoded as 1–7; MoonPhases, DaysOfMonth and Miscellaneous use character 65 plus the zero-based control index. Holiday strings use the charHolLists, charHolListsBefore and charHolListsAfter mappings. Use the published value table for the exact character-to-label associations.
User-facing meaning: Special Case Conditions (HelpContext 175915).
Literal rec_type values emitted within these routines: TDateConditionsRec. Nested values may belong to child wrappers rather than this owner itself; the attribute entries below give their exact locations.
Exact XML fields and attributes
The paths below start at this record or property node. A slash identifies a child element; @ identifies an attribute. Curly braces mark a variable index or expression, not literal XML text. Initial values describe initialization; they do not establish what an omitted individual element does. The Implementation toggle below contains the supplied routines for exact branch order and conversions.
BoolType
XML representation: The text of the BoolType element.
Reading: Reads the element into BoolType when the record node exists.
Writing: Stores the numeric value of BoolType (see the value table below) whenever the writer reaches this field.
Weekdays
XML representation: The text of the Weekdays element.
Reading: Reads the element into Weekdays when the record node exists.
Writing: Stores Weekdays whenever the writer reaches this field.
Holidays
XML representation: The text of the Holidays element.
Reading: Reads the element into Holidays when the record node exists.
Writing: Stores Holidays whenever the writer reaches this field.
DaysOfMonth
XML representation: The text of the DaysOfMonth element.
Reading: Reads the element into DaysOfMonth when the record node exists.
Writing: Stores DaysOfMonth whenever the writer reaches this field.
Miscellaneous
XML representation: The text of the Miscellaneous element.
Reading: Reads the element into Miscellaneous when the record node exists.
Writing: Stores Miscellaneous whenever the writer reaches this field.
MoonPhases
XML representation: The text of the MoonPhases element.
Reading: Reads the element into MoonPhases when the record node exists.
Writing: Stores MoonPhases whenever the writer reaches this field.
@rec_type
XML representation: The rec_type attribute.
Writing: Stores the literal text “TDateConditionsRec” whenever the writer reaches this field.
Initialization and reset values
This type has no separate initializer in the supplied code. Its starting values come from its enclosing object, inherited initialization, or existing state. Relevant enclosing initializers are identified below.
Enclosing initialization contexts
The following enclosing routines establish or override this record’s starting values. Follow the owner link for the complete initializer. Different enclosing objects can supply different defaults.
TLineEndingOptionsRec.Initialize is documented in TLineEndingOptionsRec.
Value namespaces used by this implementation
These are declared Pascal ordinal values. Use the ordinal only where the field serializer actually writes ord(...), an integer cast or an equivalent value. Set-marker strings and local option lists have their own representation; sentinel members in an enum are not automatically legal XML choices.
TIndividualConditionState
Ordinal |
Declared member |
0 |
icsFalse |
1 |
icsTrue |
2 |
icsNotRelevant |
TConditionBoolType
Ordinal |
Declared member |
0 |
cbtAny |
1 |
cbtAll |
Condition character meanings are maintained in TDateConditionsRec Values. These read/write methods preserve strings but do not contain the evaluator.
Storage declarations relevant to interpretation
These are in-memory member and property types, not a list of mandatory XML children. They retain array bounds, fixed buffers and selector types. The field reference above defines what is actually serialized.
Name |
Declared type / bounds |
Kind |
BoolType |
TConditionBoolType |
member |
Weekdays |
string |
member |
Holidays |
string |
member |
DaysOfMonth |
string |
member |
Miscellaneous |
string |
member |
MoonPhases |
string |
member |
The Implementation toggle contains only TDateConditionsRec methods. Initializers and helpers belonging to other types are identified separately below. Shared XML-helper limitations are explained in Reading this reference.
Declaration reproduces this record’s complete declaration from the supplied source, including its fields, properties and method signatures.
Topic 189650, last updated on 06-Oct-2026