Z
zz770813
Unregistered / Unconfirmed
GUEST, unregistred user!
如何将串口下的16进制转成10进制.如下代码
procedure TFCOMM.Comm1ReceiveData(Sender: TObject; Buffer: Pointer;
BufferLength: Word);
var
i:integer;
begin
viewstring:='';
move(buffer^,pchar(@rbuf)^,bufferlength);
for i:=1 to bufferlength do
viewstring:=viewstring+inttohex(rbuf,2)+'';
viewstring:='接受'+viewstring;
memo1.lines.add(viewstring);
memo1.lines.add('');
end;
procedure TFCOMM.Comm1ReceiveData(Sender: TObject; Buffer: Pointer;
BufferLength: Word);
var
i:integer;
begin
viewstring:='';
move(buffer^,pchar(@rbuf)^,bufferlength);
for i:=1 to bufferlength do
viewstring:=viewstring+inttohex(rbuf,2)+'';
viewstring:='接受'+viewstring;
memo1.lines.add(viewstring);
memo1.lines.add('');
end;