t3x.org / t3x / t3x-manual / 339.html
 
T3X - A Minimum Procedural Language
Version 8.1.5, Online Edition
Copyright(C) 1996-2004
Nils M Holm
 
Previous:
3.3.8 LOWER
TOC | Index | Back Next:
3.3.10 SPACE

3.3.9 MAP

CHR.MAP() ! => Bvec

Return the character property map stored internally. This map is a byte vector of 128 members containing flags for describing each ASCII character. It can be used to implement faster character class checks. For example,

IF (CHR.LOWER(c)) ...

can be written as

chrmap := CHR.MAP();
...
IF (chrmap::c & (CHAR.C_UPPER|CHAR.C_ALPHA) = CHAR.C_ALPHA) ...

which saves a procedure call each time a character is tested for being lower case.

The following public constants are defined in the CHAR class and can be used for testing character flags:

Flag Property
CHAR.C_ALPHA alphabetic
CHAR.C_UPPER upper case
CHAR.C_DIGIT decimal digit
CHAR.C_XDIGIT hexa-decimal digit
CHAR.C_SPACE white space
CHAR.C_CNTRL control character
Previous:
3.3.8 LOWER
TOC | Index | Back Next:
3.3.10 SPACE