AnsiChar
Belongs to : TypeDescription
The AnsiChar type is used to hold single characters. It is guaranteed to be 8 bits in size.
At the time of writing, it is the same size as Char but the latter may change in the future.
It can be assigned from a character or integer value.
Example code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
var myChar : AnsiChar; begin myChar := 'G'; // Assign from a character constant ShowMessage('Letter G = '+myChar); myChar := #65; // Assign from an integer constant ShowMessage('#65 = '+myChar); myChar := ^I; // Assign from a control char - tab ShowMessage('Control '+myChar+' character'); myChar := Chr(66); // Using Chr to convert a number ShowMessage('Chr(66) = '+myChar); myChar := Char(67); // Using Char as a standard cast ShowMessage('Char(67) = '+myChar); end; { Letter G = G #65 = A Control character Chr(66) = B Char(67) = C } |