Ord

The language construct ord(someVariable) evaluates to the index of any ordinal type, including, but not limited to any integer type and sub-ranges thereof, char, boolean, or any enumerative type.

see also

edit