by scott moore <nospam@[EMAIL PROTECTED]
>
Dec 19, 2007 at 08:18 AM
Roman Töngi wrote:
> I have no pascal environment and do not want
> to install one just for this question.
>
> 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.