Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
clivecook59@gmail.com writes: > So i have a virtual machine application and i want to be able to pass > a path to it when i run it. So for example, > > pro software, data_path > > blah > > blah > > end > > i then save this as a virtual machine program -> software.sav and i > run it as, > > idl -vm=path+software.sav > > So my question is how do i pass the data_path? You can't pass it directly into the program in the way you are trying to do it. Rather, you have to use a -arg command line switch on the IDL command you are using and pass it that way. Inside your program, you can recover the command line argument (or arguments) using the function COMMAND_LINE_ARGS. See the on-line help for "command line switches" for details. Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.dfanning.com/ Sepore ma de ni thui. ("Perhaps thou speakest truth.")
On Jun 14, 3:58 pm, David Fanning <n...@dfanning.com> wrote: > clivecoo...@gmail.com writes: >> So i have a virtual machine application and i want to be able to pass >> a path to it when i run it. So for example, > >> pro software, data_path > >> blah > >> blah > >> end > >> i then save this as a virtual machine program -> software.sav and i >> run it as, > >> idl -vm=path+software.sav > >> So my question is how do i pass the data_path? > > You can't pass it directly into the program in the way > you are trying to do it. Rather, you have to use a > -arg command line switch on the IDL command you are using > and pass it that way. > > Inside your program, you can recover the command line argument > (or arguments) using the function COMMAND_LINE_ARGS. > > See the on-line help for "command line switches" for details. > > Cheers, > > David > -- > David Fanning, Ph.D. > Fanning Software Consulting, Inc. > Coyote's Guide to IDL Programming:http://www.dfanning.com/ > Sepore ma de ni thui. ("Perhaps thou speakest truth.") You can also use environment variables, if appropriate.