for i := 0 to MSComm1.RThreshold - 1 do //32字节Hex转换
begin
if MSComm1.InputMode = comInputModeText then //单行字符转换
Edit3.Text := Edit3.Text + inttohex(byte(str[i + 1]), 2) + ' '
else //单行二进制数据转换
Edit3.Text := Edit3.Text + inttohex(buffer[i], 2) + ' ';
end;
这段中什么是单行字符串转化呀,如果是换算到一个数组里面,而不是编辑框的话应该怎么写这两句呀?
begin
if MSComm1.InputMode = comInputModeText then //单行字符转换
Edit3.Text := Edit3.Text + inttohex(byte(str[i + 1]), 2) + ' '
else //单行二进制数据转换
Edit3.Text := Edit3.Text + inttohex(buffer[i], 2) + ' ';
end;
这段中什么是单行字符串转化呀,如果是换算到一个数组里面,而不是编辑框的话应该怎么写这两句呀?
BufChar: array of char;
...
Setlength(BufChar,MSComm1.RThreshold);
if MSComm1.InputMode = comInputModeText then
CopyMemory(@BufChar[0],@str[1],MSComm1.RThreshold)
else
CopyMemory(@BufChar[0],@buffer[0],MSComm1.RThreshold);