来自:SuperJS, 时间:2001-12-25 14:03:00, ID:811113
procedure TForm1.Button1Click(Sender: TObject);
var
strTemp:string;
iCount,iCur:integer;
begin
strTemp:='I like this game';
iCount:=0;
for iCur:=1 to Length(strTemp) do
begin
iCount:=iCount+byte(strTemp[iCur]);//byte转换成一个字节
//
iCount:=iCount+ord(strTemp[iCur]);//ord是求在ASCII的序号,就是ASCII的值
end;
showmessage('strTemp的AscII值的和是:'+IntToStr(iCount));
end;