tags:

views:

367

answers:

1

I noticed today that in D2009 (with update 1), TStringStream.ReadString does not move the Position in the Stream anymore like it used to do up to D2007.
So, looping on MyStringStream.ReadString(10) would always read the 1st 10 chars of the stream instead of moving along and getting all the stream 10 chars by 10 chars. I checked the doc, it still says that ReadString should move the Position...
Can anyone confirm if it is a bug in the D2009 code or if there has been a design change (and why) and the doc is obsolete?
Thanks...

Update: Reported issue in QC #68582

+6  A: 

Definitely a bug and an ugly compatibility breakage. If you check the Classes.pas, you'll see Unicode and non-Unicode version of the ReadString. Non-Unicode version is incrementing the FPosition while Unicode is not. Both original D2009 and Update 1 are behaving the same.

Please report it in QC.

gabr
Already done: QC#68216
Uwe Raabe
Could not find it. Created a new one: #68582
François