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

Home » Public Forums » archive » Re: Default interactive integer type
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: Default interactive integer type [message #35032] Fri, 09 May 2003 10:22 Go to next message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
"Kenneth P. Bowman" wrote ...
> "Rick Towler" wrote:
>
>>> Is there any way to change the default integer type for interactive
use
>>> or is explicit specification of the type the only solution?
>>
>> Sure! Just issue the compiler option in your main session:
>>
>> IDL> i=1
>> IDL> help,i
>> I INT = 1
>> IDL> compile_opt IDL2
>> IDL> i=1
>> IDL> help, i
>> I LONG = 1
>>
>> This will stick until you reset your IDL session.
>
>
> Duh!
>
> I guess I can be forgiven since the docs say:
>

I don't slow myself down by reading the docs. Sure, it may lead to some
embarrassment along the way but it makes working with IDL much more
exciting!Sheesh, you must be one of these people that actually reads the
manual before he uncrates that new gizmo. :)


> RESET_SESSION does not re-run the startup.pro file, does it?

Unfortunately IDL doesn't re-run the startup.pro file when you reset your
session. That has bit me a number of times :(


-Rick
Re: Default interactive integer type [message #35033 is a reply to message #35032] Fri, 09 May 2003 10:20 Go to previous messageGo to next message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <b9gl6m$i82$1@news.doit.wisc.edu>,
"Liam Gumley" <Liam.Gumley@ssec.wisc.edu> wrote:

> That's such a good idea, I've added it to my IDL startup file
>
> compile_opt idl2

Well, if Liam didn't know about it, I don't feel so bad. :-)

Ken
Re: Default interactive integer type [message #35035 is a reply to message #35033] Fri, 09 May 2003 09:32 Go to previous messageGo to next message
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
"Rick Towler" <rtowler@u.washington.edu> wrote in message
news:b9gjau$20sa$1@nntp6.u.washington.edu...
>
> "Kenneth P. Bowman" wrote
> ...
>> In a procedure or function the default integer type can be changed from
>> INT to LONG with
>>
>> COMPILE_OPT DEFINT32
>>
>> or
>>
>> COMPILE_OPT IDL2
>>
>> Is there any way to change the default integer type for interactive use
>> or is explicit specification of the type the only solution?
>>
>> IDL> i = 32
>> IDL> help, i
>> I INT = 32
>> IDL> i = 32L
>> IDL> help, i
>> I LONG = 32
>>
>
> Sure! Just issue the compiler option in your main session:
>
> IDL> i=1
> IDL> help,i
> I INT = 1
> IDL> compile_opt IDL2
> IDL> i=1
> IDL> help, i
> I LONG = 1
>
>
> This will stick until you reset your IDL session.

That's such a good idea, I've added it to my IDL startup file
(idl_startup.pro):

if !version.os_family eq 'unix' then device, true_color=24
window, /free, /pixmap, colors=-10
wdelete, !d.window
device, decomposed=0, retain=2, set_character_size=[10, 12]
device, get_visual_depth=depth
compile_opt idl2
print, 'Display depth: ', strcompress(depth)
print, 'Color table size: ', strcompress(!d.table_size)
print, 'Default integer type: ', size(0, /tname)


Now I'll see if it breaks any old code!

Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/
Re: Default interactive integer type [message #35036 is a reply to message #35035] Fri, 09 May 2003 09:31 Go to previous messageGo to next message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <b9gjau$20sa$1@nntp6.u.washington.edu>,
"Rick Towler" <rtowler@u.washington.edu> wrote:

>> Is there any way to change the default integer type for interactive use
>> or is explicit specification of the type the only solution?
> Sure! Just issue the compiler option in your main session:
>
> IDL> i=1
> IDL> help,i
> I INT = 1
> IDL> compile_opt IDL2
> IDL> i=1
> IDL> help, i
> I LONG = 1
>
> This will stick until you reset your IDL session.


Duh!

I guess I can be forgiven since the docs say:

"The COMPILE_OPT statement allows the author to give the IDL compiler
information that changes some of the default rules for compiling the
function or procedure within which the COMPILE_OPT statement appears."

So does everyone have

COMPILE_OPT IDL2

in their startup.pro?

RESET_SESSION does not re-run the startup.pro file, does it?

Ken
Re: Default interactive integer type [message #35037 is a reply to message #35036] Fri, 09 May 2003 08:59 Go to previous messageGo to next message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
"Kenneth P. Bowman" wrote
...
> In a procedure or function the default integer type can be changed from
> INT to LONG with
>
> COMPILE_OPT DEFINT32
>
> or
>
> COMPILE_OPT IDL2
>
> Is there any way to change the default integer type for interactive use
> or is explicit specification of the type the only solution?
>
> IDL> i = 32
> IDL> help, i
> I INT = 32
> IDL> i = 32L
> IDL> help, i
> I LONG = 32
>

Sure! Just issue the compiler option in your main session:

IDL> i=1
IDL> help,i
I INT = 1
IDL> compile_opt IDL2
IDL> i=1
IDL> help, i
I LONG = 1


This will stick until you reset your IDL session.

-Rick
Re: Default interactive integer type [message #35113 is a reply to message #35032] Mon, 12 May 2003 13:00 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Rick Towler wrote:

>
> "Kenneth P. Bowman" wrote ...
>> "Rick Towler" wrote:
>>
>>>> Is there any way to change the default integer type for interactive
> use
>>>> or is explicit specification of the type the only solution?
>>>
>>> Sure! Just issue the compiler option in your main session:
>>>
>>> IDL> i=1
>>> IDL> help,i
>>> I INT = 1
>>> IDL> compile_opt IDL2
>>> IDL> i=1
>>> IDL> help, i
>>> I LONG = 1
>>>
>>> This will stick until you reset your IDL session.
>>
>>
>> Duh!
>>
>> I guess I can be forgiven since the docs say:
>>
>
> I don't slow myself down by reading the docs. Sure, it may lead to some
> embarrassment along the way but it makes working with IDL much more
> exciting!Sheesh, you must be one of these people that actually reads the
> manual before he uncrates that new gizmo. :)
>
>
>> RESET_SESSION does not re-run the startup.pro file, does it?
>
> Unfortunately IDL doesn't re-run the startup.pro file when you reset your
> session. That has bit me a number of times :(
>
>
> -Rick

Does it help to add a @start_up into each critical source.

On the other hand if you set integer always to long this takes a lot of
memory for indexing of arrays. Or did you explicity write
a=5s if you like "a" to be a short integer.


Reimar

--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: IDL random number generator
Next Topic: ROI with IDLanROI & IDLgrROI

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

Current Time: Wed Oct 08 13:57:18 PDT 2025

Total time taken to generate the page: 0.00658 seconds