H
hanshun398
Unregistered / Unconfirmed
GUEST, unregistred user!
var senddata:array[1..10] of char; sendstr:string;
begin
senddata[1]:=chr($ff); //要发送的数据
senddata[2]:=chr($ff);
senddata[3]:=chr($ff);
senddata[4]:=chr($07);
senddata[5]:=chr($80);
senddata[6]:=chr($+strtoint(edit1.Text));
senddata[7]:=chr($11);
for i:=1 to 7 do
sendstr:=sendstr + senddata;
mscomm2.output:=sendstr;
end;
各位大虾请指导小弟,如何将edit内的值大于128时的值转成char类型,也就是当edit中输入224时 senddata[6]:=chr($e0);
begin
senddata[1]:=chr($ff); //要发送的数据
senddata[2]:=chr($ff);
senddata[3]:=chr($ff);
senddata[4]:=chr($07);
senddata[5]:=chr($80);
senddata[6]:=chr($+strtoint(edit1.Text));
senddata[7]:=chr($11);
for i:=1 to 7 do
sendstr:=sendstr + senddata;
mscomm2.output:=sendstr;
end;
各位大虾请指导小弟,如何将edit内的值大于128时的值转成char类型,也就是当edit中输入224时 senddata[6]:=chr($e0);