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

Home » Public Forums » archive » Re: IDL 5.3 serious problem: save files sneakily restored
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: IDL 5.3 serious problem: save files sneakily restored [message #21390 is a reply to message #21387] Thu, 24 August 2000 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Vinay L. Kashyap (kashyap@head-cfa.harvard.edu) writes:

> IDL 5.3 appears to have a major hull breach.
>
> If there is an idl save file named "<whatever>.sav" in the current
> directory,
> the contents of that file get restored whenever <whatever> is referenced as
> a function within IDL.
>
> Comments?

Uh, I'm not sure it's a hull breach. If I understand
you correctly this has been a behavior of IDL for a
long, long time.

If you have a piece of code like this:

IDL> a = junker()

IDL assumes that JUNKER is a function. Many people
think IDL goes looking in the !Path for a file junker.pro,
but in fact it looks for a file junker.sav *first*. This
is so that if you have compiled the file junker.pro and
saved it:

IDL> .Compile junker.pro
IDL> Save, junker, /Routines, File='junker.sav'

the compiled version will be found and used. You don't
have to always be compiling everything and slowing yourself
down. A *very* nice feature of IDL that I like a lot.

You are just running into a situation in which you
have a variable and a function with the same name.
It's not an unknown problem in IDL, but a relatively
rare one, given the huge number of functions and variables
people create. IDL does an excellent job of keeping track
normally.

I think the solution is to just be a little more
careful with naming conventions. Perhaps a dollar
sign ($) in the name if the file contains saved
variables and not saved routines.

Cheers,

David

P.S. Let's just say having to be careful is a whole
lot better than having to be rigorous and compile
everything every time we need it. :-)
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: idl 5.2 -> 5.3 problem: cw_form
Next Topic: idl 5.2 -> 5.3 problem: cw_form

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

Current Time: Fri Oct 17 23:12:47 PDT 2025

Total time taken to generate the page: 2.24214 seconds