Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Text /
Appendix B - International Resources / Long-Date-Format Resource (Type 'itl1')


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 single RTS 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 the Itl1ExtRec 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;
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:
 ConstantValueExplanation
 calGregorian0Gregorian calendar
 calArabicCivil1Arabic civil calendar
 calArabicLunar2Arabic lunar calendar
 calJapanese3Japanese calendar
 calJewish4Jewish calendar
 calCoptic5Coptic calendar
 calPersian6Persian calendar
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.
Each table in the '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.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996