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

Home » Public Forums » archive » Re: pointer to structures
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: pointer to structures [message #19565 is a reply to message #19558] Tue, 04 April 2000 00:00 Go to previous messageGo to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
eeeyler@my-deja.com (eeeyler@my-deja.com) writes:

> suppose I wish to create a structure and wish to reference that
> structure and its contents via a pointer:
> filter=ptr_new({points:['a','b'],pt1_value:200, pt2_value:'X_WHYLOG'})
> how do I reference the points array? I thought it would be as:
> print, *filter.points
> but I get the message
> %Expression must be a structure in this context: Filter

The problem here is that a pointer dereference has the lowest
order of precedence. Lower, even, than a structure dereference.
So, you must first dereference the structure (by using
parentheses), and *then* dereference the pointer, like this:

filter=ptr_new({points:['a','b'],pt1_value:200, pt2_value:'X_WHYLOG'})
Print, *(filter.points)

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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: get variables name
Next Topic: Re: Speed up movie in object graphics.

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

Current Time: Mon Dec 01 04:52:15 PST 2025

Total time taken to generate the page: 0.00250 seconds