F flyerer1 Unregistered / Unconfirmed GUEST, unregistred user! 2010-05-18 #1 var t1 :array[0..11] of byte; S :string; 写了个api串口接收数据ReadFile(hcom,PChar(S)^,cbNum,Cbread,LpolR); //读串口 如何将S的值赋给t1byte数组?
var t1 :array[0..11] of byte; S :string; 写了个api串口接收数据ReadFile(hcom,PChar(S)^,cbNum,Cbread,LpolR); //读串口 如何将S的值赋给t1byte数组?
S smlabc Unregistered / Unconfirmed GUEST, unregistred user! 2010-05-18 #2 CopyMemory(@t1, Pointer(S), Length(S));
S szhcracker Unregistered / Unconfirmed GUEST, unregistred user! 2010-05-18 #3 S := 'abcd'; t1[0] := Byte(S[1]);
S szhcracker Unregistered / Unconfirmed GUEST, unregistred user! 2010-05-18 #4 smlabc的方法更好,但最好改为CopyMemory(@t1, Pointer(S), Length(t1));以防止 S 长度大于 12 的情况。