function DecToInt(temp:string):integer; //2进制转10进制 var i,j :
Integer; begin result := 0; j := Length(temp); //取得字符串长度;
for I := 0 to Length(temp)-1 do begin result :=
result+strtoint(Copy(temp,j,1))*Trunc(power(2,I)); //Trunc
把Extended转为int64类型 Dec(j); //递减,相当于 j := j-1; end; //
ShowMessage(IntToStr(result)); end;