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

Home » Public Forums » archive » Re: new object from a save/restore doesn't execute init function
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: new object from a save/restore doesn't execute init function [message #35173] Fri, 16 May 2003 13:14
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
paul wisehart (wisehart@runbox.com) writes:

> I am trying to put my object code into an IDL save file
> so that its easier for me to share/maintain code.
>
> This is my situation:
> I have a class.
> The init method of the class prints some output.
> (just to verify that the init function is being executed.)
> I have "saved" all of the routines of my class/object:
> IDL> save , /routines, 'my_class::init', 'my_class::pro_1', ... etc.
>
> This is my problem:
> I "restore" the above save file.
> I instantiate a "my_class" object.
>
> IDL> o = obj_new('my_class')
>
> I don't get the output from the init method !?
> How come my object is not executing the init function?
>
> I can:
> IDL> o->pro_1 ;this works
>
> Also:
> If I instantiate the object *without* restoring the save file
> IDL outputs the text from the init method.
> (This obviously only works if the code files are named correctly,
> and in my path.)
>
> Can someone see the error in may ways?

Say what!? I don't think so. :-)

Did you save the routine my_class__define? I think
you are not running the object definition code (or
INIT code) you think you are. After starting a fresh
IDL session, restore your files, create your object.
Now, type: Help, /Source

Is the MY_CLASS::INIT function the one you think
you are *suppose* to be using?

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: running IDL without the DE
Next Topic: plotting from high values to low values

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

Current Time: Fri Oct 10 11:36:09 PDT 2025

Total time taken to generate the page: 0.64079 seconds