[fpc-pascal] Weird string behavior

Michael Van Canneyt michael at freepascal.org
Tue Jul 26 16:47:18 CEST 2016



On Tue, 26 Jul 2016, Santiago A. wrote:

> El 26/07/2016 a las 16:19, Michael Van Canneyt escribió:
>>
>>
>> On Tue, 26 Jul 2016, Santiago A. wrote:
>>
>>> El 26/07/2016 a las 12:27, Mattias Gaertner escribió:
>>>> a3:=a1+a2 => cp = 1252
>>>> a3:=a2+a1 => cp = 65001
>>> Is that the expected behavior?
>>>
>>> IMHO the result should be the same. And the only way is to make it
>>> depend on a3, no matter what is in the left side. That's the way things
>>> are done in Pascal
>>
>> This is not correct. In pascal the right-hand side of an assignment
>> has a well-defined type. The compiler checks whether the type on the
>> right is assignment-compatible to the left side.
> Sorry I meant no matter what is in the right side. Other way my statment
> has no sense ;-)

Well, I'm also not sure what left/right sides you are referring to:

left/right of := or left/right of +

But as long as Jonas is on top of things, all will be well =-)

Michael.


More information about the fpc-pascal mailing list