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

Home » Public Forums » archive » Re: 'object' in IDL terminalogy
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: 'object' in IDL terminalogy [message #55964] Sun, 23 September 2007 13:18
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
kerber_80@yahoo.com writes:

> i'm little confused by IDL terminalogy. objects are created by OBJ_NEW
> function
>
> myObject = OBJ_NEW('ClassName')
>
> Does ClassName - object or class ???
> myObject is reference to ...what ???

OBJ_NEW creates a specific "instance" of an object
of a particular class. An object class or classname
refers to a general class of things (e.g., dogs).
The specific instance of the object class is something
particular (e.g., Echo or Prairie, both Golden Retrievers
who study IDL at the foot of David).

> And question without object programming
> i have two variables
>
> A = 10
> B = PTR_NEW(10)
>
> where are A and B stored ?

A and B are both local variables, stored at the level of
the program modules where they are defined.

> value '10' for B variable in heap (heap PC
> or heap IDL VM ???) how about A variable ?

The variable B, however, points to a global memory
location where the number 10 is stored, as opposed
to A, which points to a local memory location where
a different number 10 is stored. If you delete the
variables A and B, perhaps by exiting the program
module where they are created, IDL can reuse the
location where A stored its data, but the location
where B stored its data is now full and inaccessible
to you. This is called "leaking memory".

You might be interested in the Pointer Tutorial:

http://www.dfanning.com/misc_tips/pointers.html

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: 'object' in IDL terminalogy
Next Topic: spectral resampling in ENVI

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

Current Time: Fri Oct 10 12:49:49 PDT 2025

Total time taken to generate the page: 1.04148 seconds