This topic covers the implementation details of TmcMoonPhases.
Scope: TypeDefinitions.pas; record. Prepared from the curated implementation supplied for this review on 2 October 2026.
Serializes moon-phase selections/attributes using the supplied enum and per-item loop. The writer assigns TMoonPhaseKind to item nodes; distinguish this marker from the container’s own type. Check current callers before adding this older representation to new TmcOptions XML.
Notation and shared helper rules: Reading this reference.
Literal rec_type values emitted within these routines: TMoonPhaseKind, TmcMoonPhases. 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.
Visible
XML representation: The text of the Visible element.
Reading: Reads the element into Visible when the record node exists.
Writing: Stores true or false according to Visible whenever the writer reaches this field.
@rec_type
XML representation: The rec_type attribute.
Writing: Stores the literal text “TmcMoonPhases” whenever the writer reaches this field.
VisiblePhases/@rec_type
XML representation: The rec_type attribute.
Writing: Stores the literal text “TMoonPhaseKind” when Visible is true.
VisiblePhases/MoonPhaseKind[@id={ord (i).toString}]/@id
XML representation: The id attribute.
Writing: Stores the text representation of ord (i) when Visible is true; for each i from low (TMoonPhaseKind) through high (TMoonPhaseKind); i is selected in VisiblePhases.
VisiblePhases/MoonPhaseKind[@id={ord (i).toString}]
XML representation: The text of the MoonPhaseKind[@id={ord (i).toString}] element.
Writing: Stores true or false according to true when Visible is true; for each i from low (TMoonPhaseKind) through high (TMoonPhaseKind); i is selected in VisiblePhases.
Import: This routine does not read this field. See the inherited or enclosing implementation where applicable.
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.
TMiniCalOptions.Create is documented in TMiniCalOptions.
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.
TMoonPhaseKind
Ordinal |
Declared member |
0 |
mooNone |
1 |
mooNew |
2 |
mooFirst |
3 |
mooFull |
4 |
mooLast |
5 |
moo18 |
6 |
moo38 |
7 |
moo58 |
8 |
moo78 |
Text-style marker encoding
An empty style set is the empty string. A nonempty set has a leading comma, a comma after every marker and a trailing comma: for example ,B,I,FOSI,. The parser looks for complete case-sensitive marker substrings. HIDE replaces the ordinary style selection; RSET and IGNR are still processed. tsoAppend is declared but is not encoded by these two helpers.
Stored marker |
Style member |
HIDE |
tsoHide |
B |
tsoBold |
I |
tsoItalic |
UL |
tsoUnderline |
O |
tsoOutline |
SHD |
tsoShadow |
STRK |
tsoStrikeThru |
WUL |
tsoWordUnderline |
SCAP |
tsoSmallCaps |
ALLC |
tsoAllCaps |
SUP |
tsoSuperScript |
SUB |
tsoSubscript |
OVRPRT+ |
tsoOverprint |
FONA |
tsoFontName |
FOSI |
tsoFontSize |
FOSH |
tsoFontShade |
FOOP |
tsoFontOpacity |
FOCO |
tsoFontColor |
CHTX |
tsoChangeText |
HOSC |
tsoHorScale |
VESC |
tsoVertScale |
TRAK |
tsoTrack |
KERN |
tsoKern |
BASH |
tsoBaseShift |
SKW |
tsoSkew |
LEAD |
tsoLeading |
RSET |
tsoReset |
IGNR |
tsoIgnoreAllOthers |
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 |
Visible |
Boolean |
member |
VisiblePhases |
TqppMoonPhases |
member |
Font |
TFontAttr |
member |
The Implementation toggle contains only TmcMoonPhases 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.