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

Home » Public Forums » archive » Destroying objects
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: Destroying objects [message #38041 is a reply to message #37981] Mon, 16 February 2004 11:55 Go to previous messageGo to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Wed, 11 Feb 2004 16:26:44 -0600, Michael Wallace wrote:

> I have just started working with the IDL-Java Bridge and object
> programming in general and have a very basic question. Is there a way
> to destroy objects that get created which you haven't explicitly created
> yourself? Here's a simple example of the problem:
>
>
> ; Method 1
> ; Get the number of columns of a Java ResultSet
>
> cols = (result_set -> getMetaData()) -> getColumnCount()
> obj_destroy, result_set
>
> help, /heap ; shows an object associated with ResultSetMetaData
> ; but how do you destroy it??
>

> So, is there a way to use Method 1, but still have a way to destroy the
> extra object that gets created? There's no variable name associated
> with it, so how can I use obj_destroy, if at all? Will I be forced to
> go by Method 2 and use only one '->' per line? I was so hopeful I could
> be lazy and use multiple '->' per line.... *sigh*

Not pretty, but:

cols = ((meta = result_set -> getMetaData())) -> getColumnCount()
obj_destroy,meta,result_set

should work. Then again, you have to wonder about returning objects
whose only purpose is to report a value and then get destroyed. I
should think something like:

result_set->GetMetaData,COLUMN_COUNT=cols

would be a much cleaner syntax, and not employ any intermediary
objects to keep track of.

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Destroying objects
Next Topic: Re: shading/outlining on surface plot

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

Current Time: Fri Oct 10 14:24:09 PDT 2025

Total time taken to generate the page: 0.48084 seconds