Re: running and compiling programs in different folder from main directory [message #82624] |
Wed, 02 January 2013 02:21 |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
On Wednesday, January 2, 2013 4:19:36 AM UTC-5, sid wrote:
> Hi everyone,
>
> I have 33 folders in one directory inside each folder there is a idl program. So totally 33 programs. I want run and compile all the 33 programs from the main directory at one stretch. Is it possible to do like that in idl.
It really depends on how much automation you want.
It's legal to type
.run path1/program1.pro
.run path2/program2.pro
and so on, so you if you don't mind typing lines like that 33 times, you can do it "at one stretch."
Or, you could create a text file.pro which has all 33 of the ".run" commands as above, and then use @file.pro to run them "at one stretch." That requires you to edit 33 lines, but only one @file.pro typed at the IDL command line. This has the advantage that when you run IDL from the DOS prompt or Unix prompt, you can pass file.pro as an DOS/Unix argument and IDL will execute each one of those .run lines. In other words, this is the pathway towards complete scriptability.
If you don't know how many directories, or the directories change each time, then it gets a little trickier. I personally would use a different scripting program to create an @file and then run it with IDL.
If you need to do this many many times, then reconsider your approach. Don't scatter your IDL .pro files in each directory.
Craig
|
|
|