| Re: manipulate ouput keywords [message #79563 is a reply to message #79562] |
Tue, 13 March 2012 07:47  |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
The extra variable is made differently when you use _ref_extra or just _extra. If you use _extra, it is a structure with one field for each keyword. But if _ref_extra is used, it is an array of keyword names. The values would have to be accessed with scope_varfetch using its /ref_extra keyword.
This is described in the "Keyword Inheritance" section of the help, though it does have something wrong:
"variable e, within TEST, contains an anonymous structure with the value:
[ ‘LINESTYLE‘, ‘THICK‘ ]"
Where the variable is a string array, not a structure.
On Tuesday, March 13, 2012 11:05:19 AM UTC-3, nata wrote:
> Hello guys,
>
> I am developing a library and I am completely lost in something that I don't know if it's possible to do.
> My problem is related to the output keywords that some routines can have. What I am trying to do is to collect those keywords using the extra or ref_extra keyword and return the correct output value to the caller.
>
> I don't know if this is clear but see the example below:
>
> IDL> TEST, OUT1=out1, OUT2=out2
>
> PRO TEST, _REF_EXTRA=extra
>
> ;; My routine should be able to return the values for out1 and out2
> ;; without knowing the keyword names, is that possible ?
>
> END
>
> I tried with something like extra={OUT1: 1, OUT2: 2} but the caller does not receive the information properly.
>
> Please, any help will be appreciated,
> nata
|
|
|
|