Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 02:21 PM
Net Mongrel
Guest
 
Posts: n/a
Default hex to string

converting string to hex like so:

for x = 1 to len(source)
target = target & hex(ascw(mid(source,x,1)))
next

How to convert it back to a string?

I got as far as:

for x = 1 to len(source) step 2
target = target & chr("&H" & mid(source,x,2))
next

but this fails with the pound sign (£ - £)

--
Net


  #2  
Old July 19th, 2005, 02:21 PM
Stan Scott
Guest
 
Posts: n/a
Default Re: hex to string

Can't you just use the escape() and unescape() methods? These convert to
hex and back.

Stan Scott
New York City

"Net Mongrel" <netmongrel@blueyonder.co.uk> wrote in message
news:9TZLc.5980$AI5.60994688@news-text.cableinet.net...[color=blue]
> converting string to hex like so:
>
> for x = 1 to len(source)
> target = target & hex(ascw(mid(source,x,1)))
> next
>
> How to convert it back to a string?
>
> I got as far as:
>
> for x = 1 to len(source) step 2
> target = target & chr("&H" & mid(source,x,2))
> next
>
> but this fails with the pound sign (£ - &pound;)
>
> --
> Net
>
>[/color]


  #3  
Old July 19th, 2005, 02:21 PM
Net Mongrel
Guest
 
Posts: n/a
Default Re: hex to string

Stan Scott wrote:[color=blue]
> "Net Mongrel" <netmongrel@blueyonder.co.uk> wrote in message
> news:9TZLc.5980$AI5.60994688@news-text.cableinet.net...[color=green]
>> converting string to hex like so:
>>
>> for x = 1 to len(source)
>> target = target & hex(ascw(mid(source,x,1)))
>> next
>>
>> How to convert it back to a string?
>>
>> I got as far as:
>>
>> for x = 1 to len(source) step 2
>> target = target & chr("&H" & mid(source,x,2))
>> next
>>
>> but this fails with the pound sign (£ - &pound;)
>>[/color]
> Can't you just use the escape() and unescape() methods? These
> convert to hex and back.
>[/color]

Thanks Stan, that's javascript right? I did a little digging and played
around with the calls. They don't really do what I had in mind.

I do need to get the hex pairs for each character and then change them back.

--
Net


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles