Source Code



Convert hexa to decimal

  • anonymous
  • Dec 30' 13
  • Delphi
  • 169
  • 201
  • United States

This is source to convert Hexa to Decimal format;

 

function HEX_to_DEC(Value: string): Int64;
 var
  Lunghezza, i : Byte;
  ValoreDEC: Int64;
  Value2 : string;
 begin
  Result := 0;
  for i := 1 to Length( Value ) do
   Value2 := Value[ i ] + Value2;
   Value := Value2;
  for Lunghezza := Length(Value) - 1 downto 0 do
  begin
    ValoreDEC := Pos(Value[Lunghezza +1],''0123456789ABCDEF'')-1;
    if (ValoreDEC  15) then
     begin
     ShowMessage(''Valore inserito non valido'');
      Result := 0;
      exit;
     end;
    Result := Result + ValoreDEC shl (4 * Lunghezza);
  end;
 end;
  • Tags : hexa, decimal, convert
comments powered by Disqus

Related Code

convert minutes in a days / hours / minutes format

How to convert Short to Long filenames



Category

Tag Linked