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

Home » Public Forums » archive » Re: 4 byte integers
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: 4 byte integers [message #66822] Fri, 12 June 2009 16:26 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On Jun 12, 5:19 pm, Joshua Von Korff <joshlegan...@hotmail.com> wrote:
> Is there any way I can set a flag to force IDL to consider all
> integers as having 4 bytes?  It's happened many times that I assume a
> number won't go above 32768, and then months later, it does go above.
> This produces an error that can be annoying to track down.  So I've
> taken to writing 0L, 1L, 2L, lindgen() at all times, but sometimes I
> forget.  Any thoughts?
>
> It's not even clear to me that IDL is saving any time by restricting
> to 2 bytes ... aren't they represented as 4 bytes at some lower level
> anyway?

Try "comile_opt defint32" (or "compile_opt idl2" which also throws in
the "strictarr" option which I recommend):

IDL> help, 0
<Expression> INT = 0
IDL> compile_opt defint32
IDL> help, 0
<Expression> LONG = 0

The catch is that it still needs to be done on a routine by routine
basis (there is no "master switch" to throw for this).

Mike
--
www.michaelgalloy.com
Associate Research Scientist
Tech-X Corporation
[Message index]
 
Read Message
Read Message
Previous Topic: Re: How to visit www.dfanning.com?
Next Topic: yet another idl memory question

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

Current Time: Wed Oct 08 15:52:48 PDT 2025

Total time taken to generate the page: 0.00459 seconds