Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 18-11-2014
elmago00 elmago00 is offline
Miembro
NULL
 
Registrado: ago 2013
Posts: 86
Poder: 11
elmago00 Va por buen camino
¿Cómo convertir un integer a hexadecimal?

Hola que tal,
e estado intentado convertir un integer a un hexadecimal, que de como resultado:

Código:
[size - 16]

08 2A 65 13 42 65 98 22 45 00 00 00 00 00 00 00 // por que no corresponde el valor integer al este hexa
El valor integer que utilizo es 256312456892254

por ejemplo si yo convierto string a HEX:

Código Delphi [-]
function StringToHex(S: String): string;
var I: Integer;
begin
  Result:= '';
  for I := 1 to length (S) do
    Result:= Result+IntToHex(ord(S[i]),2);
end;

function HexToString(H: String): String;
var I: Integer;
begin
  Result:= '';
  for I := 1 to length (H) div 2 do
    Result:= Result+Char(StrToInt('$'+Copy(H,(I-1)*2+1,2)));
end;

y luego trato de pasar hex a string me genera un un hexa diferente.
utilizo el siguiente archivo.

UBigIntsV3.rar

Código Delphi [-]
function StrHexaToUInt64Str(const stringHexadecimal: String): string;
var
  unBigInteger:TInteger;
begin
  unBigInteger:=TInteger.Create;
  try
    // stringHexadecimal parameter is passed without the '$' symbol
    // ex: stringHexadecimal:='FFAA0256' and not '$FFAA0256'
    unBigInteger.AssignHex(stringHexadecimal);
    //the boolean value determine if we want to add the thousand separator or not.
    Result:=unBigInteger.converttoDecimalString(false);
  finally
    unBigInteger.free;
  end;
end;

Como hago para generar el mismo hexadecimal. lo que trato de hacer encontrar una función que genere lo mismo.
yo desconozco que función utilicen para generar ese raro valor hexadecimal con integer de 15


gracias por su respuesta

Última edición por elmago00 fecha: 18-11-2014 a las 20:32:25.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Convertir Binario a Hexadecimal. JoseFco ASM y Microcontroladores 21 30-10-2008 22:43:31
convertir int o char a hexadecimal. bactering C++ Builder 2 05-10-2008 21:18:45
¿Cómo convertir de word a integer? bluegene Varios 16 19-03-2007 22:31:18
String Hexadecimal '000CB2' a Cardinal o Integer onlytk Varios 2 06-11-2005 17:24:38
Como Convertir un dato Integer ó Float a String en FireBird???? AGAG4 Firebird e Interbase 8 04-12-2004 02:59:47


La franja horaria es GMT +2. Ahora son las 00:22:19.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi