comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Assigning command line arguments to variables in another procedure
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Assigning command line arguments to variables in another procedure [message #89267 is a reply to message #89261] Mon, 11 August 2014 02:56 Go to previous messageGo to previous message
Yngvar Larsen is currently offline  Yngvar Larsen
Messages: 134
Registered: January 2010
Senior Member
"You are doing it all wrong". You should read about classes in IDL:

http://www.exelisvis.com/docs/ref_part2.html
http://www.exelisvis.com/docs/creating_custom_objects.html

Hint #1: Unlike in Java, not everything is a class in IDL.

Hint #2: PRO does not implement a class, but a procedure ("function" with no return value). Thus "My = obj_new('PRO1')" with PRO1 being a procedure, does not make sense.

Hint #3: Event if PRO1 was a class with a member called A, you cannot assign to the member with "My.A" in IDL.

On Monday, 11 August 2014 00:57:40 UTC+2, tryan...@gmail.com wrote:
> 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!
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: cgBoxPlot - not a useful function!!!
Next Topic: updated "Using Python From IDL" ebook

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Mon Apr 20 13:59:58 PDT 2026

Total time taken to generate the page: 3.28046 seconds