| Re: Object method compiling [message #29360 is a reply to message #29350] |
Wed, 13 February 2002 05:27   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Harald Jeszenszky (harald.jeszenszky@oeaw.ac.at) writes:
> I have defined an object and all methods are located in the same
> <object>__define.pro file. When I create a new instance of the object
> for the first time, the routine <object>__define is compiled and the
> method <objects>::INIT is executed properly. When destroying the
> object the <objects>::CLEANUP routine is executed. All other methods
> are not compiled and therefore unknown to IDL.
It sounds to me like the <object>__define module is
not the LAST module in the file, as it should be.
Otherwise, it is hard to imagine how anything like
this could happen. Remember, in automatic compilation,
IDL will search through and compile modules UNTIL it
gets the module with the right name. If this is the
LAST module, all is well. If it is not, then all the
modules below this module in the file cannot be found.
You want to get all your modules compiled when you
create the object (I.e., execute the <object>__define module.)
> Is there a way to automatically compile all other methods of the
> object (e.g. by using RESOLVE_ROUTINE in the <object>__define
> rountine)?
This really should not be required if the object code is
structured properly. Beyond putting the <object>__define module
last in the file, I typically assemble the rest of the modules
alphabetically (so I can find them easily), but all this is
completely arbitrary and up to you.
Cheers,
David
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
|