Delphi Pages Forums

Delphi Pages Forums (http://www.delphipages.com/forum/index.php)
-   VCL (http://www.delphipages.com/forum/forumdisplay.php?f=4)
-   -   How to convert Hexadecimal to STRING (http://www.delphipages.com/forum/showthread.php?t=207096)

Mujaidin 09-01-2009 11:02 AM

How to convert Hexadecimal to STRING
 
How to convert Hexadecimal to STRING???
please can you show me an exemple code, using
the value here below.

Exemple value :
HEXADECIMAL STRING RESULT
5349414E4F204D494348454C45 -> SIANO MICHELE

Regards, Alessandro

KevMc 09-01-2009 06:04 PM

Hi,

This function should help you.

Code:

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;

Cheers

Kevin

Mujaidin 09-02-2009 12:13 PM

reply
 
tanks kevin!!


All times are GMT. The time now is 07:06 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2017, vBulletin Solutions, Inc.