Hi Bob, > Don't forget to: delete [] cp; I had forgotten, thank you. > I think that StrToInt will properly handle the input "0xAB" It does indeed, thanks again. Nigel Duckworth ----- Original Message ----- From: "Bob Ammerman" To: Sent: Friday, May 28, 2004 2:01 PM Subject: Re: [OT:] C++ AnsiString conversion? > > > > > long result; > > char * endptr; > > char* cp = new char[ TextString.Length() + 1 ]; > > > > strcpy( cp, TextString.c_str() ); > > > > result = strtol(cp, &endptr, 16); > > > > ResultString = (char) result; > > > > Memo2->Lines->Add(ResultString); > > Don't forget to: > > delete [] cp; > > > > > I have to say Borlands description of StrToInt is very misleading; > > > > "StrToInt converts the string S, which represents an integer-type number > in > > either decimal or hexadecimal notation, into a number". > > I think that if StrToInt will properly handle the input "0xAB" > > Bob Ammerman > RAm Systems > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.