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

Home » Public Forums » archive » Re: Pointer and structure question
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 and structure question [message #81724] Sat, 13 October 2012 19:58 Go to previous message
timmyb89 is currently offline  timmyb89
Messages: 4
Registered: October 2012
Junior Member
Thanks, too easy.

On Saturday, October 13, 2012 10:20:36 PM UTC+11, TimB wrote:
> I'm having trouble accessing a structure referred to by a pointer. Here's a simplified example of what I want to do.
>
>
>
> array=replicate(ptr_new(/ALLOCATE_HEAP),2)
>
> *array[0]={var1:1.0,var2:2.0}
>
>
>
> x=*array[0]
>
> print,x.var1
>
> print,*array[0].var1
>
>
>
>
>
> print,x.var1 works, print,*array[0].var1 gives the error "Expression must be a structure in this context: ARRAY.". I need to be able to access var1 without creating the x variable as seen in this example. What am I doing wrong?
>
>
>
> Thanks, Tim
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: IDL 8.2.1 released
Next Topic: Overlay a coloured boundary on a gray scale image

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

Current Time: Wed Oct 08 18:15:21 PDT 2025

Total time taken to generate the page: 0.00379 seconds