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

Home » Public Forums » archive » Re: Problem with pointers 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: Problem with pointers to structures [message #38657] Wed, 17 March 2004 23:39 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Tianle Yuan wrote:
> This bothers me for quite a while and I still can't figure out why it
>
> doesn't work.
>
> Pro A
> .
> .
> str = {f1:..,f2:..,...}
> str_ptr = ptr_new(str)
> .
> .
> widget_control,...,set_uvalue = str_ptr
> .
> .
> end
>
> Pro A_sub,event
> .
> widget_control,...,get_uvalue= str_ptr
> temp = *str_ptr
> temp.f1 = ...
>
> end
>
> When I excute it, it says 'expression must be a structure in this
>
> context:temp'. But according to Gumley's book, this should work fine.
>
> Any comments?
>
> -TL
>

You did not have said what you like to put on temp.f1


IDL> str={f1:1,f2:2}
IDL> ptr=ptr_new(str)
IDL> temp=*ptr
IDL> help,temp,/str
** Structure <82e79ec>, 2 tags, length=4, data length=4, refs=3:
F1 INT 1
F2 INT 2
IDL> temp.f1=10
IDL> PTR_FREE,ptr

Please try this! Does this work?



Reimar



--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
============================================================ =======
[Message index]
 
Read Message
Read Message
Previous Topic: About 'dilate'
Next Topic: dynamically change the layout of widget

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

Current Time: Thu Oct 09 21:08:23 PDT 2025

Total time taken to generate the page: 0.72118 seconds