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

Home » Public Forums » archive » Re: hexadecimal variables
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: hexadecimal variables [message #15078] Thu, 22 April 1999 00:00
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
Hi,

Pavel Romashkin wrote:
>
> Hi,
> Is there a nice way to convert hexadecimal variables? Here's what I am
> trying to do:
>
> This is received from the outside.
> h_string = '40000FC0DA'
>
> [...] Can anyone suggest a neater way
> to do this? Maybe, there is a way to use Z-formatted READ here?

You've got it, using ReadS (read from string). It looks like you have five
bytes so you need a very long integer to store this, giving me the first
chance I've had to use IDL 5.2's new data types:

IDL> h_string = '40000FC0DA'
IDL> long64=0LL
IDL> ReadS, h_string, long64, Format='(Z0)'
IDL> help, long64
LONG64 LONG64 = 274878939354

Hope this works OK for you.

Cheers,
--
-Dick

Dick Jackson Fanning Software Consulting, Canadian Office
djackson@dfanning.com Calgary, Alberta Voice/Fax: (403) 242-7398
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Previous Topic: New IDL book!
Next Topic: Re: Object Oriented programming question

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

Current Time: Sat Oct 11 14:44:36 PDT 2025

Total time taken to generate the page: 0.80118 seconds