comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Convert String to Hexadecimal Number
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Convert String to Hexadecimal Number [message #39396] Tue, 11 May 2004 16:00
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
James Kuyper writes:

> reads,'e4f3',data,FORMAT='(Z)'
> print,data

Oh, right. :-(

Thanks, James.

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Convert String to Hexadecimal Number [message #39397 is a reply to message #39396] Tue, 11 May 2004 15:45 Go to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
David Fanning wrote:
> Folks,
>
> I guess I could figure this out, eventually, but it has already
> been a long day, and it's getting longer...
>
> Suppose I have a string, 'e4f3', representing a hexadecimal
> number. Does anyone have a good algorithm for converting
> this to a decimal number? (I mean without having to
> remember any of that 8th grade base8, base16 nonsense.)

reads,'e4f3',data,FORMAT='(Z)'
print,data
Re: Convert String to Hexadecimal Number [message #39398 is a reply to message #39397] Tue, 11 May 2004 15:44 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> I guess I could figure this out, eventually, but it has already
> been a long day, and it's getting longer...
>
> Suppose I have a string, 'e4f3', representing a hexadecimal
> number. Does anyone have a good algorithm for converting
> this to a decimal number? (I mean without having to
> remember any of that 8th grade base8, base16 nonsense.)

Whoa! I came up with this about 5 seconds after I hit
the SEND button. Is this legitimate?

var = 'e4f3'
ok = Execute("test = '" + var + "'x")
Print, test
58611

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Object Graphics
Next Topic: get image location?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Tue Oct 21 15:49:14 PDT 2025

Total time taken to generate the page: 1.20324 seconds