Hola, chequea el truco 181 de trucomania, esta en Delphi pero lo podes pasar fácilmente:
Código Delphi
[-]
function HexToInt(const Value: String): Integer;
begin
Result := StrToInt('$' + Value);
end;
Ejemplo de llamada:
Código Delphi
[-] Label1.Caption:=IntToStr( HexToInt('FF') );
Otra funcion:
Código Delphi
[-]function HextoInt(HexStr:string):integer;
const Hex : array['A'..'F'] of integer = (10,11,12,13,14,15);
var
i : integer;
begin
Result:=0;
for i := 1 to Length(HexStr) do
if HexStr[i] < 'A' then Result := Result * 16 + Ord(HexStr[i]) - 48
else Result := Result * 16 + Hex[HexStr[i]];
end;
Bytes..