[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: IDL 5.3 serious problem: save files sneakily restored
- Subject: Re: IDL 5.3 serious problem: save files sneakily restored
- From: davidf(at)dfanning.com (David Fanning)
- Date: Thu, 24 Aug 2000 19:47:19 -0600
- Newsgroups: comp.lang.idl-pvwave
- Organization: Fanning Software Consulting
- References: <firstname.lastname@example.org>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:21048
Vinay L. Kashyap (email@example.com) writes:
> IDL 5.3 appears to have a major hull breach.
> If there is an idl save file named "<whatever>.sav" in the current
> the contents of that file get restored whenever <whatever> is referenced as
> a function within IDL.
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
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
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.
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: firstname.lastname@example.org
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155