Important: The information in this document is obsolete and should not be used for new development.
The Itl1ExtRec Data Type
The standard long-date-format resource has several limitations. First, it assumes that seven day names and 12 month names are sufficient, which is not true for some calendars. For example, the Jewish calendar can have 13 months in some years. Second, it assumes that day and month names can be abbreviated by simply truncating them to a fixed length, but this not true in many languages.An optional extension to the long-date-format resource provides additional information that solves these problems. The Text Utilities routines that generate date strings use information in the
'itl1'
extension if it is present.The standard long-date-format resource ends with a variable-length field (
localRtn
) originally intended to be used for code that alters the built-in U.S. sorting behavior. This field is no longer needed, because code for changing the sorting behavior is now in the string-manipulation ('itl2'
) resource.In existing unextended long-date-format resources, the
localRtn
field contains a singleRTS
instruction (hexadecimal $4E75). In extended long-date-format resources, the hexadecimal value $A89F is the first word in thelocalRtn
field. (This is the unimplemented trap instruction, which could not have been the first word of any valid local routine.) The resource extension follows immediately after that word.You can access the contents of the
'itl1'
resource extension through theItl1ExtRec
data type.
TYPE Itl1ExtRec = RECORD base: Intl1Rec;{un-extended Intl1Rec} version: Integer; {version number} format: Integer; {format code} calendarCode: Integer; {calendar code for 'itl1'} extraDaysTableOffset: LongInt; {offset to extra days table} extraDaysTableLength: LongInt; {length of extra days table} extraMonthsTableOffset: LongInt; {offset to extra months table} extraMonthsTableLength: LongInt; {length of extra months table} abbrevDaysTableOffset: LongInt; {offset to abbrev. days table} abbrevDaysTableLength: LongInt; {length of abbrev. days table} abbrevMonthsTableOffset:LongInt; {offset to abbr. months table} abbrevMonthsTableLength:LongInt; {length of abbr. months table} extraSepsTableOffset: LongInt; {offset to extra seps table} extraSepsTableLength: LongInt; {length of extra seps table} tables: ARRAY[0..0] OF Integer; {the tables; variable-length} END;Each table in the
Field Description
base
- A standard (unextended) long-date-format resource.
version
- The version number of this extension. Unlike the
intl1Vers
field in the unextended'itl1'
resource, this field contains nothing but the version number.format
- A number that identifies the format of this resource. The current extended long-date-format resource format has a format code of 0.
calendarCode
Multiple calendars may be available on some systems, and it is necessary to identify the particular calendar for use with this long-date-format resource. Constants for the currently defined calendars are as follows:
- The Script Manager initializes part of the script variable accessed through the selector
smScriptNumDate
with the value in this field.- extraDaysTableOffset
- The offset from the beginning of the long-date-format resource to the extra days table.
- extraDaysTableLength
- The length in bytes of the extra days table.
- extraMonthsTableOffset
- The offset from the beginning of the long-date-format resource to the extra months table.
- extraMonthsTableLength
- The length in bytes of the extra months table.
- abbrevDaysTableOffset
- The offset from the beginning of the long-date-format resource to the abbreviated days table.
- abbrevDaysTableLength
- The length in bytes of the abbreviated days table.
- abbrevMonthsTableOffset
- The offset from the beginning of the long-date-format resource to the abbreviated months table.
- abbrevMonthsTableLength
- The length in bytes of the abbreviated months table.
- extraSepsTableOffset
- The offset from the beginning of the long-date-format resource to the extra separators table.
- extraSepsTableLength
- The length in bytes of the extra separators table.
tables
- The tables that make up the rest of the
'itl1'
resource extension.'itl1'
resource extension is an array consisting of an integer
count followed by a list of Pascal strings specifying names of days, names of months,
or separators.
- Extra days table. A list of names. This format is for those calendars with more than 7 day names.
- Extra months table. A list of names. This format is for those calendars with more than 12 months.
- Abbreviated days table. A table of abbreviations. If the header specifies an offset to and length of the abbreviated days table, the Text Utilities routines that create date strings use this table instead of truncating day names to the number of characters specified in the
abbrevLen
field of the standard'itl1'
resource.- Abbreviated months table. A table of abbreviations. If the header specifies an offset to and length of the abbreviated months table, the Text Utilities routines that create date strings use this table instead of truncating month names to the number of characters specified in the
abbrevLen
field of the standard'itl1'
resource.- Extra separators table. A list of additional date separators. When parsing date strings, the Text Utilities
StringToDate
andStringToTime
functions permit the separators in this list to be used in addition to the date separators specified elsewhere in the numeric-format and long-date-format resources.