Re: Naming batch files and main-level programs [message #51068 is a reply to message #50997] |
Thu, 02 November 2006 15:52   |
Robi
Messages: 9 Registered: October 2006
|
Junior Member |
|
|
Hi there Jean,
>>> But if your routine is called 'fred' and you save it in a file called
>>> fred.idl.pro, when you call fred, IDL will be looking for fred.pro...
>>> and therefore not find it.
>>
>> Right, you'd have to do @fred.bat or .run fred.main
>
> No, he means that if you have a function/procedure "foo", it must be
> saved in the file foo.pro if you want IDL to find it. If you save it in
> bar.pro, IDL will not find it.
Ah, right, that's true, but I'm not suggesting that. Routines named
routine_name should be stored in filed name routine_name.pro. That
whole .idl thing was for batch files... I'm not, and never was,
suggesting that a *routine* be stored in routine_name.idl.pro.
> For a batch file, it would work... not that in this case it is uselless
> to save as a .pro... You can save it as foo.idl and type @foo.idl
> the good point of .pro extension is that you don't have to type it...
> @foo = @foo.pro
I completely disagree with your assertion that it is useless to save a
batch file as a .pro file. It is true that the file can be named
foo.idl and that @foo.idl would work, but ONLY if (a) you are in the
directory in which foo.idl is stored, (b) that directory was explicitly
added to !PATH, or (c) there happens to be a .sav or .pro file in that
directory so that it was added to !PATH via the "+" mechanism.
Moreover, one of the suggestions was to store all the batch files in a
directory named batch/ ... well, there ya go... that entire directory
would be skipped by the "+" path expansion because there would be no
.pro files in it. So you'd have to be in that directory to use those
batch files, or worse, have to execute them with a fully-qualified path
to the batch file.
> Now for your question, yes, you can have multiple points...
Great, thanks for confirming that.
> Here is another suggestion, close to Greg's one:
> why don't you call your files b_name.pro for the batch files and
> name.pro for the routines? elegant, small, obivous...
Certainly true, good idea; maybe, in my mind, not as obvious to someone
who didn't create the files as the .bat.pro or .main.pro suffixes.
Anyway, it sounds like this is just not something most people have
encountered. I guess I can go back to assuming I'm the only one
worrying about this oddity.
Best -Tim.
|
|
|