HOW CHARACTERS ARE INTERNALLY REPRESENTED
Internally, most computers store characters according to the
ASCII format. ASCII stands for American Standard Code for
Information Interchange. Characters are stored according to a
numbered sequence, whereby A has a value of 65 decimal, B a value
of 66 etc. Several functions which manipulate characters follow.
CHR
The chr or character position function returns the
character associated with the ASCII value being asked,
eg,
chr( 65 ) will return the character A
ORD
The ord or ordinal function returns the ASCII
value of a requested character. In essence, it works
backwards to the chr function. Ordinal data types
are those which have a predefined, known set of values.
Each value which follows in the set is one greater than
the previous. Characters and integers are thus ordinal
data types.
ord( 'C' ) will return the value 67
SUCC
The successor function determines the next value
or symbol in the set, thus
succ( 'd' ) will return e
PRED
The predecessor function determines the previous
value or symbol in the set, thus
pred( 'd' ) will return c
Copyright B Brown/P Henry, 1988-1999. All rights reserved.