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

Home » Public Forums » archive » Re: Returning values within _EXTRA.
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: Returning values within _EXTRA. [message #12486] Thu, 13 August 1998 00:00 Go to previous message
Vap User is currently offline  Vap User
Messages: 31
Registered: April 1998
Member
Imanol Echave <ccaeccai@sc.ehu.es> writes:

I'm going to answer this one again to spare myself a little egg on the
face occasioned by my previous answer. I just read the help for
Obj_destroy and find that you can specify both arguments and keywords.
So you should pass keywords to the getproperty method using
_ref_extra.

Consider the following

FUNCTION junk::Init, prop1, prop2
IF n_params() NE 2 THEN return,0
self.prop1 = prop1
self.prop2 = prop2
return,1
END

PRO junk::cleanup, _ref_extra = extra
self-> get,_extra = extra
END

PRO junk::get, prop1 = prop1, prop2=prop2
IF arg_present( prop1 ) THEN prop1 = self.prop1
IF arg_present( prop2 ) THEN prop2 = self.prop2
END

PRO junk::set, prop1 = prop1, prop2=prop2
IF n_elements( prop1 ) NE 0 THEN self.prop1 = prop1
IF n_elements( prop2 ) NE 0 THEN self.prop2 = prop2
END

PRO junk__define
junk = {JUNK,$
prop1:0l,$
prop2:0l }

END

IDL> .run /tmp/junk__define.pro
% Compiled module: JUNK::INIT.
% Compiled module: JUNK::CLEANUP.
% Compiled module: JUNK::GET.
% Compiled module: JUNK::SET.
% Compiled module: JUNK__DEFINE.
IDL> j=obj_new('junk',1,2)
IDL> j->get,prop1=p1,prop2=p2 & print,p1,p2
1 2
IDL> j->set,prop1=3,prop2=10
IDL> j->get,prop1=p1,prop2=p2 & print,p1,p2
3 10
IDL> obj_destroy,j,prop1=pp1,prop2=pp2
IDL> print,pp1,pp2
3 10
IDL>



>
> Hi people:
>
> When you use a keyword parameter on a program, it's possible to change the
> value of the keyword (if it's a named value), OK. But, I want to do the same
> using the _EXTRA keyword, and it doesn't work (because a tag of a structure is
> passed by value, I think). Anybody knows how to do it?
>
> An example: I'm creating a class, and on the CLEANUP method I want to return
> the object properties values on keywords, so I call the GETPROPERTY method
> within the CLEANUP method. I tried this:
>
> PRO ...::Cleanup,_EXTRA=extra
>
> self->GetProperty,_EXTRA=extra
> ...
> END
>
> But it doesn't work. Any advice?

--
I don't speak for JPL, it doesn't speak for me.
Well, not all the time, at least.
William Daffer <vapuser@haifung.jpl.nasa.gov>
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Labelling Highs/Lows in contour
Next Topic: Re: RPC in IDL 5.0

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

Current Time: Fri Oct 10 11:57:14 PDT 2025

Total time taken to generate the page: 0.48182 seconds