Important: The information in this document is obsolete and should not be used for new development.
FillParseTable
TheFillParseTable
function helps your application to quickly process a buffer of mixed 1-byte and 2-byte characters. It returns a 256-byte table that distinguishes the character codes of all possible 1-byte characters from the first (high-order) byte values of all possible 2-byte characters in the specified script system.
FUNCTION FillParseTable (VAR table: CharByteTable; script: ScriptCode): Boolean;
table
- A 256-byte table to be filled in by FillParseTable.
script
- A value that specifies the script system the parse table belongs to. Constants for all defined script codes are listed on page 6-52. To specify the font script, pass
smCurrentScript
in this parameter.DESCRIPTION
Before callingFillParseTable
, allocate space for a 256-byte table to pass to the function in the table parameter.The information returned by
FillParseTable
is a packed array defined by theCharByteTable
data type as follows:
CharByteTable = PACKED ARRAY[0..255] OF SignedByte;In every script system, 2-byte characters have distinctive high-order (first) bytes that allow them to be distinguished from 1-byte characters.FillParseTable
fills a 256-byte table, conceptually equivalent to a 1-byte character-set table, with values that indicate, byte-for-byte, whether the character-code value represented by that byte index is the first byte of a 2-byte character. An entry in theCharByteTable
is 0 for a 1-byte character and 1 for the first byte of a 2-byte character.If your application is processing mixed characters, it can use the table to identify the locations of the 2-byte characters as it makes a single pass through the text, rather than having to call
CharacterByteType
orCharacterType
for each byte of the text buffer in turn.CharacterByteType
andCharacterType
start anew at the beginning of the text buffer each time they are called, tracking character positions up to the offset of the byte to be analyzed.SPECIAL CONSIDERATIONS
FillParseTable
may move memory; your application should not call this function at interrupt time.The table defined by
CharByteTable
is not dynamic; it does not get updated when the current font changes. You need to call it separately for each script run in your text.The return value from
FillParseTable
is alwaysTRUE
.If you specify
smCurrentScript
for thescript
parameter, the value returned byFillParseTable
can be affected by the state of the font force flag. It is unaffected by the international resources selection flag.