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

Home » Public Forums » archive » Re: IDL 5 Syntax ?
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: IDL 5 Syntax ? [message #16793] Tue, 17 August 1999 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Eric Kihn (eak@ngdc.noaa.gov) writes:

> I have a syntax question regarding IDL objects. I have a object
> which has as one of it's data elements
> a pointer to a structure (data). In a method (draw) if I try to
> access part of the structure like:
>
> plot, *self.data.X
>
> I get the dread "Must be a structure in this context" message. (Which
>
> I think it is)
> Where as if I do a :
> ds = *self.data
>
> Plot,ds.X
>
> Everypne is happy. Why?

Because the pointer dereference has the lowest order
of precedence. Lower, even, than a structure dereference.
So in the code that doesn't work, the data structure is
dereferenced first, and then the pointer is dereferenced.
But the pointer dereference is not dereferencing a pointer
at that point, so this syntax fails.

What you can do (in all of IDL) is put parentheses
around something that you want to have a higher order
of precedence, since parentheses have the highest order
precedence. This will work:

Plot, (*self.data).x

Cheers,

David

--
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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: TLB Widget resizing
Next Topic: TLB Widget resizing

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

Current Time: Tue Oct 21 08:40:59 PDT 2025

Total time taken to generate the page: 0.79224 seconds