Is this a valid expressen:
'A' + 'A'
yielding 130 if ord('A') = 65
thx
ord('A') + ord('A')
or
chr(ord('A') + ord('A'))
If you want the result to also be a character.
Pascal is a typed language. 'A'+'A' is asking the
compiler to add two characters which is not possible,
since it has no meaning. In reality, you are asking
to add the character codes together, and you are asking
the compiler to automatically convert the characters to
their integer equivalents.
Pascal does not have a problem with that, it just wants
you to explicitly state what you are doing.
No. 'A' is a character, not a number. However:
ord('A') + ord('A')
will yield a number. What it is depends on your system.
--
Merry Christmas, Happy Hanukah, Happy New Year
Joyeux Noel, Bonne Annee.
Chuck F (cbfalconer at maineline dot net)
<http://cbfalconer.home.att.net>
--
Posted via a free Usenet account from http://www.teranews.com