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

Home » Public Forums » archive » Re: Passing objects and parenthesis... doing something wrong here?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Passing objects and parenthesis... doing something wrong here? [message #82678] Wed, 09 January 2013 09:44
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
Hi again,
I'm going to change my original post. You are absolutely correct: This was *not* fixed in IDL 8.2.0. It was actually a slightly different bug that got fixed. You'll have to upgrade to 8.2.1 to get the bug fix.
Sorry for the confusion.
-Chris
Re: Passing objects and parenthesis... doing something wrong here? [message #82679 is a reply to message #82678] Wed, 09 January 2013 09:15 Go to previous message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
Hey Helder,

If you're going to upgrade, you might as well go straight to IDL 8.2.1.

Cheers,
Chris
p.s. And yes, David, you're right, you always want to have a ::Cleanup method, just in case.
Re: Passing objects and parenthesis... doing something wrong here? [message #82680 is a reply to message #82679] Wed, 09 January 2013 08:47 Go to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Wednesday, January 9, 2013 5:35:01 PM UTC+1, Chris Torrence wrote:
> Hi Helder,
>
>
>
> This was a bug, but has now been fixed. However, looking at my change log, it looks like it was fixed for IDL 8.2.
>
>
>
> Is it possible that you are running either IDL 8.1, or a beta version of IDL 8.2?
>
>
>
> If you want, try the following code:
>
>
>
> pro test_junk::mymethod
>
> o1 = obj_new('idlgrplot')
>
> o1.symbol = obj_new('idl_container')
>
> print, o1.symbol.nlist
>
> ; % Attempt to call undefined method: 'IDL_CONTAINER::GetProperty'.
>
> end
>
>
>
> pro test_property_on_object
>
> a = {test_junk, field1: 0}
>
> a = obj_new('test_junk')
>
> a->mymethod
>
> end
>
>
>
> If you get a syntax error when you save and run this, then you must be running an older version of IDL.
>
>
>
> Hope this helps!
>
>
>
> -Chris
>
> ExelisVIS
>
> p.s. you actually don't need to have a cleanup method for these objects, or call obj_destroy, because the automatic garbage collection will take care of it. :-)

Hi Chris,
thanks for the answer... my heart starts beating again. I get an error with your code on my laptop:

% Expression must be a structure in this context: <OBJREF (<ObjHeapVar4(IDL_CONTAINER)>)>.
% Execution halted at: TEST_JUNK::MYMETHOD 4 F:\Test\testobjects.pro
% TEST_PROPERTY_ON_OBJECT 11 F:\Test\testobjects.pro
% $MAIN$

I'm running IDL 8.2.0, Build id: 20120410 (from the help window).

I guess this is a beta version and tonight I will update. At least I know that the code I've written does not need major rewriting/mending...

Thanks again.

Cheers,
Helder
Re: Passing objects and parenthesis... doing something wrong here? [message #82681 is a reply to message #82680] Wed, 09 January 2013 08:42 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Chris Torrence writes:

> p.s. you actually don't need to have a cleanup method for these objects, or call obj_destroy, because the automatic garbage collection will take care of it. :-)

Although, I would argue that if there is even a remote possibility that
your code might escape your office, that failure to have a Cleanup
method will make you vulnerable to considerable embarrassment. :-)

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: Passing objects and parenthesis... doing something wrong here? [message #82682 is a reply to message #82681] Wed, 09 January 2013 08:35 Go to previous message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
Hi Helder,

This was a bug, but has now been fixed. However, looking at my change log, it looks like it was fixed for IDL 8.2.

Is it possible that you are running either IDL 8.1, or a beta version of IDL 8.2?

If you want, try the following code:

pro test_junk::mymethod
o1 = obj_new('idlgrplot')
o1.symbol = obj_new('idl_container')
print, o1.symbol.nlist
; % Attempt to call undefined method: 'IDL_CONTAINER::GetProperty'.
end

pro test_property_on_object
a = {test_junk, field1: 0}
a = obj_new('test_junk')
a->mymethod
end

If you get a syntax error when you save and run this, then you must be running an older version of IDL.

Hope this helps!

-Chris
ExelisVIS
p.s. you actually don't need to have a cleanup method for these objects, or call obj_destroy, because the automatic garbage collection will take care of it. :-)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: idlwave: Breakpoints don't work
Next Topic: String to float

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

Current Time: Wed Oct 08 19:26:55 PDT 2025

Total time taken to generate the page: 0.00308 seconds