meta data for this page
  •  
CHAR type variables

CHAR (character) types are suitable for storing a single letter each. The original CHAR uses codes from the ancient ASCII character mapping table. This table contains a mix of 255 different characters (letters, numbers, control characters, graphic symbols). Its advantage is that it requires only 1 byte, but its disadvantage is that the character set is quite limited; for example, Hungarian or Chinese accented characters are mostly excluded.

The extended version of CHAR is WCHAR (wide-character), which has a 2-byte length but can be used more broadly with its (UNICODE) UCS-2 mapping. Up to 65,535 character mappings can be encoded with 16 bits; UNICODE does not fully utilize this range.

When declaring an operand of data type WSTRING you can define its length using square brackets (for example WSTRING[10]). If you do not specify a length, the length of the WSTRING is set to 254 characters by default.

TypeNameBitCode tableValue range HEXValue range DECExample
CHARcharacter8ASCII0 .. FF0 .. 255'P', CHAR#'P'
WCHARWide character16UCS-2$0000 - $D7FF0 .. 55.295WCHAR#'Ő'
Special characters

A character string can also contain special characters. The escape character $ is used to identify control characters, dollar signs and single quotation marks.

CharacterHexMeaningExample
$L or $l000ALine feed'$LText', '$000AText'
$N000A and 000DLine break
The line break occupies 2 characters in the character string.
'$NText',
'$000A$000DText'
$P or $p000CPage feed'$PText', '$000CText'
$R or $r000DCarriage return (CR)'$RText','$000DText'
$T or $t0009Tab'$TText', '$0009Text'
$$0024Dollar sign'100$$t', '100$0024t'
$'0027Single quotation mark'$'Text$'','$0027Text$0027