Re: Attempt to subscript FILNAM with I is out of range.... [message #31728 is a reply to message #31727] |
Fri, 16 August 2002 01:05   |
Timm Weitkamp
Messages: 66 Registered: August 2002
|
Member |
|
|
Kolbjorn,
Following Craig's suggestion is definitely the easiest (and cleanest) way,
but I think his script "run_myfile.pro" should be extended by one line
that will make all the difference:
.run myfile.pro ; compile the routine(s) contained in myfile.pro
myfile ; run procedure myfile (if that's what is in myfile.pro)
exit ; quit IDL
Don't let yourself confuse by the fact that file naming conventions in IDL
are such that the ".pro" extension is used for both batch scripts and
files containing procedures and/or functions, or by the fact that the .RUN
statement only *compiles* the routines in its argument file, but does *not
run* them. This is why the additional 2nd line in the batch file above is
needed, which must have seemed too obvious to Craig so he didn't mention
it.
Cheers,
Timm
On 15.08.02 at 16:14 -0500, Craig Markwardt wrote:
> [...]
>
> The first easiest solution is to make a separate file called
> run_myfile.pro, which contains the lonely statement:
>
> .run myfile.pro
> exit
>
> and then use "idl run_myfile.pro". Since run_myfile.pro is fed to the
> IDL command interpreter, the .RUN directive will work. Why you don't
> want to call it as a procedure, well that's up to you.
>
> Good luck,
> Craig
--
Timm Weitkamp E-mail: timm.weitkamp@psi.ch
Paul Scherrer Institut (PSI) http://people.web.psi.ch/weitkamp
CH-5232 Villigen, Switzerland
|
|
|