procedure TForm1.cmdMakeClick(Sender: TObject);
var
mycomputer,s :string;
i : integer;
begin
mycomputer:='';
for i:=1 to length(tbmac.Text) do
begin
s:=midstr(tbmac.Text,i,1);
mycomputer:=mycomputer+IntToStr(ord(s)); --报 incompatible types 错
showmessage(mycomputer);
end;
end;在上面程序片断中会报一个错,而如果把有错的那句改成mycomputer:=mycomputer+IntToStr(ord('a'))
就不会报错难道ord函数中的参数不能是变量吗?
var
mycomputer,s :string;
i : integer;
begin
mycomputer:='';
for i:=1 to length(tbmac.Text) do
begin
s:=midstr(tbmac.Text,i,1);
mycomputer:=mycomputer+IntToStr(ord(s)); --报 incompatible types 错
showmessage(mycomputer);
end;
end;在上面程序片断中会报一个错,而如果把有错的那句改成mycomputer:=mycomputer+IntToStr(ord('a'))
就不会报错难道ord函数中的参数不能是变量吗?
s : char