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 #19567 is a reply to message #19566] Tue, 04 April 2000 00:00 Go to previous messageGo to previous message
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
eeeyler@my-deja.com wrote:
> 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

ptr = ptr_new({test:indgen(10)})
print, (*ptr).test
0 1 2 3 4 5 6 7
8 9

If you want to keep it really simple and clean, separate the pointer
de-reference and the structure reference:

struct = *ptr
print, struct.test

This can make your code much more understandable when multiple levels of
de-referencing are required (say if the structure contains a pointer to
an array).

Cheers,
Liam.
http://cimss.ssec.wisc.edu/~gumley
[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: Thu Oct 09 07:38:35 PDT 2025

Total time taken to generate the page: 1.12207 seconds