I'm not sure, but perhaps it's this line:
dataStore := Integer(data[currByte]) shl 8;
I didn't know you can convert a PChar to Integer like that. Anyway, I wrote
a small example like this:
var
p: PChar;
a : integer;
begin
p := '5';
a := Integer(p);
Caption := IntToStr(a)
And the Caption doesn't return 5 but instead 4452508
If you replace the conversion line with this:
a := Integer(p[0])
Then you get 53
I would suggest you convert your PChar to String first, and then convert
from String to Integer, it works that way AFAIK :)
Gajo
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/