capital letters in file names? [message #56789] |
Fri, 16 November 2007 16:11  |
jdmcbr@gmail.com
Messages: 2 Registered: November 2007
|
Junior Member |
|
|
Hello,
Is anyone aware of there being an issue with IDL recognizing .pro
files in a directory as being associated with IDL if there are capital
letters in the file name? I got a lot of "Variable is undefined"
messages when I tried to use functions I had written within other
programs. This even occurred when I had already compiled those
functions. On a couple of occasions, if I restarted IDL and compiled
everything right at the start, it worked, but on some occasions it did
not. Finally, I removed all capital letters from filenames, and
everything has run a couple of times without issues. Is it just the
capital letters (in which case I will just avoid that in the future)
or is there another issue?
Thanks,
James
|
|
|
|
Re: capital letters in file names? [message #56864 is a reply to message #56789] |
Sun, 18 November 2007 09:39   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
hradilv writes:
> If you are using a *nix OS and you do, say, .comp test, IDL will look
> for test.pro which must contain a procedure or function called
> "test" (same capitalization). If the file name is Test.pro and the
> procedure in it is "test", then you call "Test", IDL will compile
> Test.pro creating a procedure called "test", but it won't be able to
> find "Test"
>
> Clear as mud?
And possibly misleading, as well. :-)
> If you are using a *nix OS and you do, say, .comp test, IDL will look
> for test.pro which must contain a procedure or function called
> "test" (same capitalization).
The capitalization of the procedure or function is
entirely irrelevant. IDL is case insensitive. The
name of the file should be spelled with lowercase
letters if you expect IDL to find it automatically
(as you should). If you always compile your procedures
and functions before you use them, then (really!) you
should be using another language than IDL, as there is
ABSOLUTELY no reason to do this.
You should even name your Windows files with lowercase
letters, IMHO, since you never know when you might find
yourself loaning them to someone with a machine different
from yours. This can cause an enormous amount of heartache
before you figure out what the problem is.
http://www.dfanning.com/tips/namefiles.html
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: capital letters in file names? [message #56877 is a reply to message #56789] |
Sat, 17 November 2007 10:12   |
Vince Hradil
Messages: 574 Registered: December 1999
|
Senior Member |
|
|
On Nov 16, 6:11 pm, "jdm...@gmail.com" <jdm...@gmail.com> wrote:
> Hello,
>
> Is anyone aware of there being an issue with IDL recognizing .pro
> files in a directory as being associated with IDL if there are capital
> letters in the file name? I got a lot of "Variable is undefined"
> messages when I tried to use functions I had written within other
> programs. This even occurred when I had already compiled those
> functions. On a couple of occasions, if I restarted IDL and compiled
> everything right at the start, it worked, but on some occasions it did
> not. Finally, I removed all capital letters from filenames, and
> everything has run a couple of times without issues. Is it just the
> capital letters (in which case I will just avoid that in the future)
> or is there another issue?
>
> Thanks,
> James
You should tell us what OS you are using.
If you are using a *nix OS and you do, say, .comp test, IDL will look
for test.pro which must contain a procedure or function called
"test" (same capitalization). If the file name is Test.pro and the
procedure in it is "test", then you call "Test", IDL will compile
Test.pro creating a procedure called "test", but it won't be able to
find "Test"
Clear as mud?
|
|
|
|