Einzelnen Beitrag anzeigen

Klaus01

Registriert seit: 30. Nov 2005
Ort: München
5.755 Beiträge
 
Delphi 10.4 Sydney
 
#3

Re: IntToHex funzt nicht bei Unsigned 64 Bit Integer

  Alt 12. Sep 2008, 10:25
Hallo,

diese Funktion:
Delphi-Quellcode:
function UInt64ToHex(Value: Int64): string;
type
  TByteArray = array[0..7] of Byte;
var
  I : Byte;
  B1 : ^TByteArray;
begin
  Result := '';
  //Place the pointer of bytes to the value (-:
  B1 := Addr(Value);

  for I := High(B1^) downto Low(B1^) do
    Result := Result + IntToHex(B1^[I], 2);
  while ((Result[1] = '0') and (Length(Result) > 1)) do
    Delete(Result, 1, 1);
end;
habe ich hier gefunden.

Grüße
Klaus
Klaus
  Mit Zitat antworten Zitat