Re: Virtual machine question [message #60773] |
Sun, 15 June 2008 07:39 |
Vince Hradil
Messages: 574 Registered: December 1999
|
Senior Member |
|
|
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.
|
|
|
Re: Virtual machine question [message #60776 is a reply to message #60773] |
Sat, 14 June 2008 13:58  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
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.")
|
|
|