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

Home » Public Forums » archive » Hex constants interpreted differently in IDL/v5.2
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Hex constants interpreted differently in IDL/v5.2 [message #15517] Mon, 24 May 1999 00:00
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
A colleague of mine (Craig DeForrest) pointed this out to me, and I thought it
important enough to distribute more widely. Has anybody else run into this
one?

Apparently, IDL/v5.2 interprets some hexadecimal constants differently than
previous versions. For example, the statement

IDL> help,'aa7f'x

under IDL/v5.1 produces the result

<Expression> LONG = 43647

while under IDL/v5.2, the following is returned

<Expression> INT = -21889

This change in behavior needs to be accommodated in any software which uses
hexadecimal constants.

To be affected, the hexadecimal constant needs to be exactly four bytes long,
with the first byte being in the range "8" to "f". Shorter or longer
hexadecimal constants are unaffected. Thus, constants like

'abc'x
'12345'x
'789a'x

are all okay, while constants like

'8000'x
'9abc'x
'aa7f'x

would have a different meaning under IDL/v5.2. The simplest solution is to
replace the "x" with "xl" to force the constant to be a long integer, e.g.

'8000'xl
'9abc'xl
'aa7f'xl

William Thompson
[Message index]
 
Read Message
Previous Topic: Re: Basic colors for plot
Next Topic: List yourself in SStreams�

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

Current Time: Fri Oct 10 23:06:59 PDT 2025

Total time taken to generate the page: 0.55664 seconds