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

Home » Public Forums » archive » Re: Extract a sub-structure from a structure
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: Extract a sub-structure from a structure [message #47180 is a reply to message #47179] Thu, 26 January 2006 07:42 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
L. Testut writes:

> ; it works ok until now
> ; Then as I am very optimistic I want to do that:
> tag = tag_names(stp)
> FOR i=1,N_ELEMENTS(tag)-1 DO *stp.(i)=*stp.(i)[IDP]
>
> ;but it doesnt' work ? is there somebody that can tell me what is the
> ;right way to replace in my structure the total region with the
> ;sub-region for all the parameter of course !

You have to remember that pointer dereferencing has the
*lowest* order of precedence in all the things you are doing,
*including* structure dereferencing. You code would probably
work with a few more parentheses:

FOR I=1,N_ELEMENTS(tag)-1 DO (*stp).(I)=(*stp).(I)[IDP]

But, personally, I would go with Solution 1. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Problem of precedence with pointer and structure
Next Topic: q5/ ***Hot stuff - check this out !!! q5/

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

Current Time: Sat Oct 11 02:52:05 PDT 2025

Total time taken to generate the page: 0.00784 seconds