El Thu, May 27, 2004 at 07:12:55PM +0100, Nigel Duckworth escribio: > Could someone point me in the right direction please... > > I wish to convert a Hex number from an AnsiString ("6F" for example) to it's > ASCII character ("o" in this case) for appending to another AnsiString. > > i.e. "48 65 6C 6C 6F" becomes "Hello" > > I can split the first string and append to the second no problem, it's the > conversion in the middle I'm stuck on. I thought StrToInt(); might be the > way to go but it throws an exception on the non-numeric text. It seems > logical to me to keep it Ansi rather than convert to a char, atoi(); it then > convert back again or is that the only way? Googling has provided just about > every conversion but the one I need and Borlands help... isn't any! :) I'm > using Builder 6 but perhaps this is done in Delphi? Borland's StrToInt() doesn't work because you have an HEX number, not decimal. There isn't any VCL function to do that, you can: * Use [standard C] strtol function, passing 16 as the base; * Write some simple function to do the conversion. Daniel. -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics