真的有分加?下面就是这个例了: procedure TForm1.Button1Click(Sender: TObject); const aa = 'A'; var w: DWord; ws: WideChar; s1,s2: byte; i: integer; s: string; ss: widestring; begin ss := '珞'; for i:=0 to Length(ss) do ws := ss[i]; w := DWord(ws); s := IntToHex(w, 4); showmessage(widechar(w)); showmessage(widechar($73DE)); end;
var
A:WideChar;//这种类型是用Unicode来存的
i:integer;
begin
A:='B';
i:=Ord(A);
edit1.text := inttostr(i);
end;
这样是正确的,可是‘B’如果换为String变量,怎么办?
showmessage(inttostr(dword(edit1.text));
end;
procedure TForm1.Button1Click(Sender: TObject);
const
aa = 'A';
var
w: DWord;
ws: WideChar;
s1,s2: byte;
i: integer;
s: string;
ss: widestring;
begin
ss := '珞';
for i:=0 to Length(ss) do
ws := ss[i];
w := DWord(ws);
s := IntToHex(w, 4);
showmessage(widechar(w));
showmessage(widechar($73DE));
end;