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

Home » Public Forums » archive » Re: Object definition
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 definition [message #20526] Sun, 09 July 2000 00:00
John-David T. Smith is currently offline  John-David T. Smith
Messages: 384
Registered: January 2000
Senior Member
Any named structure (of the both the regular and object-class-defining
varieties) which IDL doesn't know about will cause a search on the path for a
defining procedure "name__define.pro". We take this functionality for
granted... so much so that various confusing things can happen when it is
circumvented (e.g. by restoring an object or named structure).

JD

--
J.D. Smith |*| WORK: (607) 255-5842
Cornell University Dept. of Astronomy |*| (607) 255-6263
304 Space Sciences Bldg. |*| FAX: (607) 255-5875
Ithaca, NY 14853 |*|
Re: Object definition [message #20536 is a reply to message #20526] Fri, 07 July 2000 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Pavel Romashkin (promashkin@cmdl.noaa.gov) writes:

> I did not realize that HELP will call definition method without me
> creating an object instance first.

Well, assuming you have written the object definition
module correctly and given it and the file the correct
name. Which, since it is you, Pavel, I feel certain
is the case. :-)

Cheers,

David

P.S. Let's just say without Automatic Structure Definitions
it would be impossible to implement objects as named
structures, without (Heaven forbid) having to manually
compile them first. :-)



--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Object definition [message #20537 is a reply to message #20536] Fri, 07 July 2000 00:00 Go to previous message
promashkin is currently offline  promashkin
Messages: 169
Registered: December 1999
Senior Member
I guess I understand it now. Named structures are not retained after
session is over. If a named structure is defined as a variable, its
definition and name are gone after a session reset (or IDL quit).
However, for object definitions, executing "HELP, {my_obj}, /obj" in
fact calls the object definition code "my_obj__define" and creates a
blank instance of that object for HELP to use. Then, HELP returns info
on blank object instance. But, for a variable that contained a named
structure, such call results in the message:

% Attempt to call undefined procedure/function: 'TEMP__DEFINE'.
% Structure type not defined: TEMP.

Just as expected.
I did not realize that HELP will call definition method without me
creating an object instance first.
Cheers,
Pavel

Ben Tupper wrote:
> It is expected (at least I expect) the named structure to be retained
> from session to session. When I start-up a new session,
> I can do as you describe, HELP, {temp}, /Str and get output of all of the
> fields. The pointers are all null-pointers and the
> other fields are as I defined them in the Temp__Define procedure.
>
> I think you are describing a different behavior and I'm not clear on what
> the behavior is. As an example, it sounds like you might have defined a
> string field in the temp__DEFINE procedure as Temp.Name = ''. Later
> you did something like oTemp->SetProperty, Name = 'PAVEL'. Then you
> quit (or reset). Doing the Help, {Temp},Str shows Temp.Name =
> 'PAVEL'. Am I getting that right?g
Re: Object definition [message #20541 is a reply to message #20536] Fri, 07 July 2000 00:00 Go to previous message
Ben Tupper is currently offline  Ben Tupper
Messages: 186
Registered: August 1999
Senior Member
Pavel Romashkin wrote:

> When I define an object (user-defined), there, of course, is a named
> structure named, lets say, "temp". So I can call "help, {temp}" to see
> what the fields are. Then, I reset IDL or even quit it. Then, start it
> again and type "help, {temp}" again - the information is printed out
> about the last state of the structure! Strange.
> I use 5.3 on a Mac.
> Thanks for any input.
> Pavel

Hello,

It is expected (at least I expect) the named structure to be retained
from session to session. When I start-up a new session,
I can do as you describe, HELP, {temp}, /Str and get output of all of the
fields. The pointers are all null-pointers and the
other fields are as I defined them in the Temp__Define procedure.

I think you are describing a different behavior and I'm not clear on what
the behavior is. As an example, it sounds like you might have defined a
string field in the temp__DEFINE procedure as Temp.Name = ''. Later
you did something like oTemp->SetProperty, Name = 'PAVEL'. Then you
quit (or reset). Doing the Help, {Temp},Str shows Temp.Name =
'PAVEL'. Am I getting that right?

Ben


--
Ben Tupper

Bigelow Laboratory for Ocean Science
tupper@seadas.bigelow.org

pemaquidriver@tidewater.net
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Lat/lon to UTM coords
Next Topic: Re: Object Graphics Selection

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

Current Time: Wed Oct 08 15:36:45 PDT 2025

Total time taken to generate the page: 0.00562 seconds