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

Home » Public Forums » archive » 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
hexadecimal variables [message #15093] Wed, 21 April 1999 00:00 Go to previous message
Pavel Romashkin is currently offline  Pavel Romashkin
Messages: 166
Registered: April 1999
Senior Member
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'

h_long = long(h_string)
This, obviously, fails to recognize alphabetical hexadecimal part and
sets h_long to 40,000.

temp = execute("h_long = long(' "+h_string+" 'x)")
This, naturally, works, setting h_long to the desired 1032410, but looks
quite ugly. Besides, it is 3 times slower than without "execute" - not
really a concern on fast machines, but inefficient code just bugs me.

I am sure I am missing something here. Can anyone suggest a neater way
to do this? Maybe, there is a way to use Z-formatted READ here?

Thank you,
Pavel
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Better Fitting routine
Next Topic: Searching in a sorted array

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

Current Time: Fri Oct 10 01:23:55 PDT 2025

Total time taken to generate the page: 9.11825 seconds