HistoryCal - V0.0.7 Manual
Define format

Home Development V0.0.7 Manual Script Define format

Under Construction

format Statement

Format is both a sub-statement in the grammar statement and a statement in its own right. The only difference between the two forms is in the signature code. When used as a stand-alone statement the code is a compound code including both the grammar and its name within that grammar, the parts separated by a colon ':' character.

In its simplest form, the statement may be just a format string. A format string is a text description of the output (and/or input) where the separate elements of a date are separated by the vertical bar '|' character and the elements are identified by their field names in parenthesis '()'.


A format statement may contain of one or more of the following sub-statements:-

Sub-Statement List
inoutFormat string used for both input and output.inout "(Day) |(Month:m.a) |(Year)";
inputFormat string used for just input.input "(Day) |(Month) |(Year)";
attributesList of attributes to define the output.output "(CompDay:frcomp) |(NMDay) |(NMonth:frm) |(Year)";
outputFormat string used for just output.output "(CompDay:frcomp) |(NMDay) |(NMonth:frm) |(Year)";
rankSet the major to minor order of the fields to use when reading text input.rank "ce", "ceyear", "month", "day", "wday";
rulesDefine the rules used to interpret the formatrules iso8601;
separatorsRun code depending on condition.separators "-";
strictFormat string used for both input and output, input includes the inter-field text.strict "(Year:!lp.04)|-(Month:!lp.02)|-(Day:!lp.02)";

Sub-Statement attributes

The values given by the attribute list can affect either input, output or both. Currently attributes are only defined under rules iso8601.

Style attribute

One of the following values. If none are given calendar is assumed.

Extended attribute

One of the two following values. If neither are given extended is assumed.

Expanded attribute

One of the following values. If none are given year is assumed.

Error handling attribute

If the year cannot be output with the given attributes then the output is determined by one of the two following values. If neither are given error is assumed.

Valid XHTML 1.0 Strict

11th March 2016