Re: SAV file generation with command line arguments [message #37127] |
Wed, 19 November 2003 17:37  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
David Fanning wrote:
> Sangwoo writes:
>
>> I have a simple question. Is it possible to create a .sav application
>> from a procedure including command line arguments? I know that making
>> a .sav file from a procedure like below is absolutely possible :
>>
>> pro example
>> ....................
>> end
>>
>> But, isn't it possible from a procedure like below? :
>>
>> pro example, a, b
>> ...........................
>> end
>>
>> I know that IDL VM doesn't allow access to command line. Does it mean
>> the answer to my question is negative?
>
> No, it means the answer to your question is complicated. :-)
>
> It is true that you can't pass command line arguments
> to IDL save files. (There is no, uh, command line.)
> But that is not to say you can't write procedures
> with arguments and save them as save files. It's just
> that those arguments can't be there when the file is
> run. If you need the arguments, you have to work out
> how to get them. In other words, you have to treat them
> as optional arguments.
>
> One option is to open a dialog and allow the
> user to enter the arguments. Another option is
> to read the arguments out of a data file (which
> some people create with a shell script so that
> their program *appears* to accept command line
> arguments.
>
> Rob Dimeo brought a nifty little program to my
> attention this week that was written by Jim
> Pendleton, an RSI programmer who writes awfully
> clever IDL code, that may help with the latter.
> The program is named SOURCEROOT. It allows you
> to store data files in the same directory as
> your pro files, and then distribute the files
> to any location. The SOURCEROOT program figures
> out which directory the pro files are being
> run from, so it can locate the data files
> without having to know ahead of time where
> they are. Neat. It works like this:
>
> file = filepath('data.dat',root = sourceroot())
>
> You can find the program here:
>
> http://www.rsinc.com/codebank/search.asp?FID=35
>
> There are probably other solutions as well. But you
> have to be pretty creative to discover some of them. :-)
>
> Cheers,
>
> David
>
>
>
>
This is an old trick,
I have seen this first by Ray Sterner /JHUAPL
whocalledme, dir, file
regards
Reimar
--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
|
|
|