How to assign command line arguments to variables in another class [message #89260] |
Sun, 10 August 2014 15:56 |
tryanblogs
Messages: 3 Registered: August 2014
|
Junior Member |
|
|
IDL beginner here! Let's say I have two procedures, PRO1 and PRO2. If I receive a command line argument in PRO2, how can I assign the argument value to a variable in PRO1?
Is this possible to accomplish without passing a parameter in a procedure call? Example:
PRO PRO2
value = command_line_argument
PRO1, value
END
PRO PRO1, value
A = value
END
I have previously tried to make an object reference ,'My', to PRO1, but I receive a syntax error.
PRO PRO2
opts = ob_new('mg_options)
opts.addOption, 'value', 'v'
opts.parseArgs,error_message = errorMsg
My = obj_new('PRO1')
My.A=opts.get('value') ;syntax error on this line
END
Any insight is very much appreciated!
|
|
|