X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 15 Feb 2008 02:50 PM by  anon
passing parameters to IDL executable
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
15 Feb 2008 02:50 PM
    Dear Users, I was wondering whether it is possible to create an IDL executable which requires the person executing the code to also pass a parameter. For example: idl -rt=executable.sav "working/directory" In this case, the executable would take the string parameter with the working directory information and use it. First, I would like to know if this is possible. Second, what needs to be done in the code to make this possible and three do I have to use some special keywords when creating this executable. Thanks in advance, Conrad :)

    Deleted User



    New Member


    Posts:
    New Member


    --
    15 Feb 2008 02:50 PM
    Conrad: Since version 6.2 IDL has had the function COMMAND_LINE_ARGS to handle what you want to do. See the Online Help for this function and the associated link in that article to a second article "Command Line Options for IDL Startup". Those will help you understand why an IDL main procedure with code lines like the following: appWorkingDir = (command_line_args( ))[0] cd, appWorkingDirwill work do what you want with an IDL Runtime Command like: idl -rt=executable.sav -arg /path/to/app/working/directoryNo quotes needed around the arg (unless it contains blank spaces). James Jones
    You are not authorized to post a reply.