在VC中有如下表示法:
USHORT buf[100]={10,20,'年','月','日'};
.....而我希望在delphi中实现以上功能:
buf:array[1..100] of word;//定义一个数组,?????是否有其他方法???buf[1]:=10;
buf[2]:=20;
strpcopy(@buf[3],'年');,可是输出的汉字不是年。
这里的汉字该怎样表示,据说要涉及到VC中取高位和低位的问题,请高手指教
USHORT buf[100]={10,20,'年','月','日'};
.....而我希望在delphi中实现以上功能:
buf:array[1..100] of word;//定义一个数组,?????是否有其他方法???buf[1]:=10;
buf[2]:=20;
strpcopy(@buf[3],'年');,可是输出的汉字不是年。
这里的汉字该怎样表示,据说要涉及到VC中取高位和低位的问题,请高手指教
i:integer;
a:integer;
begin
s:=Edit13.Text; //输入-----带汉字的字符串
r:='';
edit14.Text:='';
for i:=1 to Length(s) do
begin
r:=inttostr(ord(s[i]));
if ord(s[i])>128 then
edit14.Text:=edit14.text+IntToHex(StrToInt(copy(r,1,3)),2)
else
edit14.text:=edit14.text+IntToHex(StrToInt(copy(r,1,2)),2);
end;{输出---到edit14.Text}
end;