Re: [DUG] Delphi Digest, Vol 94, Issue 7

2011-08-05 Thread Jeremy Coulter
È or 232 is not some sort of ACK or NAK is it?

-Original Message-
From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On
Behalf Of Marshland Engineering
Sent: Friday, 5 August 2011 12:34
To: delphi@delphi.org.nz
Subject: Re: [DUG] Delphi Digest, Vol 94, Issue 7

I still have something wrong

I sending
serial_send('B');
serial_send('C');
and a terminal program reads BC correctly

My Delphi code is as below but something is wrong with the second character.

if SerialPortNG.NextClusterSize = 0 then begin
   sRaw:=SerialPortNG.ReadNextClusterAsString;
   memo1.Lines.Add(sRaw);
   sData:='';
   for i:=1 to length(sRaw) do begin
   iValue:= ORD(sRaw[i]);
   sData:=sData+IntToStr(iValue)+'  ';
end;
   memo1.Lines.Add(sData);

Result
Bè
66  232
Bè
66  232
Bè
66  232

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
unsubscribe


___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe


Re: [DUG] Delphi Digest, Vol 94, Issue 7

2011-08-04 Thread Marshland Engineering
I still have something wrong

I sending
serial_send('B');
serial_send('C');
and a terminal program reads BC correctly

My Delphi code is as below but something is wrong with the second character.

if SerialPortNG.NextClusterSize = 0 then begin
   sRaw:=SerialPortNG.ReadNextClusterAsString;
   memo1.Lines.Add(sRaw);
   sData:='';
   for i:=1 to length(sRaw) do begin
   iValue:= ORD(sRaw[i]);
   sData:=sData+IntToStr(iValue)+'  ';
end;
   memo1.Lines.Add(sData);

Result
Bè
66  232
Bè
66  232
Bè
66  232

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe


Re: [DUG] Delphi Digest, Vol 94, Issue 7

2011-08-04 Thread Colin Johnsun
What version of Delphi are you using? Could the string be returned as a
Unicode string? or is it an AnsiString?

Secondly, shouldn't the for loop be: for i := 0 to Length(sRaw) do

Regards,
Colin

On 5 August 2011 10:34, Marshland Engineering marshl...@marshland.co.nzwrote:

 I still have something wrong

 I sending
serial_send('B');
serial_send('C');
 and a terminal program reads BC correctly

 My Delphi code is as below but something is wrong with the second
 character.

if SerialPortNG.NextClusterSize = 0 then begin
   sRaw:=SerialPortNG.ReadNextClusterAsString;
   memo1.Lines.Add(sRaw);
   sData:='';
   for i:=1 to length(sRaw) do begin
   iValue:= ORD(sRaw[i]);
   sData:=sData+IntToStr(iValue)+'  ';
end;
   memo1.Lines.Add(sData);

 Result
 Bè
 66  232
 Bè
 66  232
 Bè
 66  232

 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe