CharType
Mon 01 January 2018Syntax
CharType(source_str, char_code)
Description
Use the CharType function to determine whether the first character in source_str is of type char_code . The char_code parameter is a numeric value representing a character type (see the following Parameters section for details). Most character types supported by this function equate to specific Unicode character blocks or are based on Unicode character properties.
Parameters
|
Field or Control |
Definition |
|---|---|
| source_str |
A String, the first character of which will be tested. |
| char_code |
A Number representing the character type to be tested for. |
The following table shows valid values for char_code . You can specify either a Character Code or a Constant:
|
Numeric Value |
Constant |
Character Set |
|---|---|---|
|
0 |
%CharType_AlphaNumeric |
Basic Latin â Alphanumeric (printable range of 7-bit US-ASCII), Unicode characters in the range U+0020 â U+007E |
|
1 |
%CharType_ExtendedLatin1 |
Extended Latin-1 characters (ISO 8859-1 accents for Western European languages), Unicode characters in the range U+00BF â U+07E |
|
2 |
%CharType_HankakuKatakana |
Hankaku Katakana (half-width Japanese Katakana) |
|
3 |
%CharType_ZenkakuKatakana |
Zenkaku Katakana (full-width Japanese Katakana) |
|
4 |
%CharType_Hiragana |
Hiragana (Japanese) |
|
5 |
%CharType_Kanji |
Chinese, Japanese and Korean ideographic characters. Includes Japanese Kanji, Chinese Hanzi and Korean Hancha. |
|
6 |
%CharType_DBAlphaNumeric |
Full-width Latin Alphanumeric characters, primarily used for Japanese. Excludes |
|
7 |
None |
Korean Hangul syllables, excluding Hangul Jamo. |
|
8,9 |
None |
Reserved for future use. |
|
10 |
%CharType_JapanesePunctuation |
Full- and half-width punctuation, including space (U+0020) and Fullwidth / Ideographic Space (U+3000). |
|
11 |
None |
Greek |
|
12 |
None |
Cyrillic |
|
13 |
None |
Armenian |
|
14 |
None |
Hebrew |
|
15 |
None |
Arabic |
|
16 |
None |
Devanagari |
|
17 |
None |
Bengali |
|
18 |
None |
Gurmukhi |
|
19 |
None |
Gujarati |
|
20 |
None |
Oriya |
|
21 |
None |
Tamil |
|
22 |
None |
Telugu |
|
23 |
None |
Kannada |
|
24 |
None |
Malayalam |
|
25 |
None |
Thai |
|
26 |
None |
Lao |
|
27 |
None |
Tibetan |
|
28 |
None |
Georgian |
|
29 |
None |
Bopomofo |
Returns
CharType returns one of the following Number values. You can check for the constant values instead of the numeric values if you prefer:
|
Numeric Value |
Constant Value |
Description |
|---|---|---|
|
1 |
%CharType_Matched |
Character is of type char_code . |
|
0 |
%CharType_NotMatched |
Character is not of type char_code. |
|
-1 |
%CharType_Unknown |
UNKNOWN: unable to determine whether character is of set char_code. This occurs if the character being checked is an unallocated Unicode codepoint, or was added in a version of Unicode greater than that supported by PeopleTools. |