Ver Mensaje Individual
  #3  
Antiguo 06-05-2006
Avatar de Sotrono
Sotrono Sotrono is offline
Miembro
 
Registrado: abr 2004
Ubicación: Buenos Aires - Argentina
Posts: 396
Reputación: 21
Sotrono Va por buen camino
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..
Responder Con Cita