To find the ordinal value of a character we use the predefined Pascal function ord().
VAR Code:integer; ... Code := ord('B');
This will give Code the value 66 by looking up the ASCII table. Note: the character is in quotes as always, if it weren't we'd be referring to a variable.
The ordinal values of an integer is the same as the integer's values. ie. the ord(8) is 8,ord(-8) is -8 and ord(0) is 0.
The ordinal value of a boolean value is 1 for ord(true) and 0 for ord(false).