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

Home » Public Forums » archive » Re: indexing over structure tags
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: indexing over structure tags [message #24810 is a reply to message #24809] Thu, 19 April 2001 10:50 Go to previous messageGo to previous message
Bernard Puc is currently offline  Bernard Puc
Messages: 65
Registered: January 1998
Member
Randall Skelton wrote:
>
> Thanks Tom... I did think of that. However, in this particular case there
> is some merit in having the name of the structure be a useful and human
> readable tag. Nobody would be happy trying to remember yet another
> arbitrary numbering scheme for molecules when they'd rather just type the
> name ;) My suspicion is that there isn't an easy way to do what I want...
>
> Randall
>
> On Thu, 19 Apr 2001, tam wrote:
>
>> Just use the numeric tag syntax for structures.
>>
>> for i=0,n_tags(data)-1 do begin
>> data.(i).values = .. some expresion ...
>> endfor
>>
>> where the (i) indicates use the i'th element of the structure.
>> So you don't need to use the names at all.
>>
>> Regards,
>> Tom McGlynn
>>

Perhaps you misunderstood...there are two ways of accessing a tag within
a structure.

data = {lat:fltarr(10), lng:fltarr(10), sig:fltarr(10)}

Method 1:
data.lat
data.lng
data.sig

Method 2:
data.(0)
data.(1)
data.(2)

Either method accesses the same variables.


--
Bernard Puc AETC, INC.
bpuc@va.aetc.com 1225 Jefferson Davis Highway #800
(703) 413-0500 Arlington, VA 22202
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: fastest operations/fctns.
Next Topic: MBAR

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

Current Time: Wed Oct 08 18:40:11 PDT 2025

Total time taken to generate the page: 0.00414 seconds