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

Home » Public Forums » archive » IDL structure problem
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
IDL structure problem [message #93629] Wed, 14 September 2016 00:16 Go to next message
Sapna Mishra is currently offline  Sapna Mishra
Messages: 66
Registered: December 2015
Member
Dear All,

I have a structure STR which has 43 tags.
IDL> print,N_tags(STR)
43

IDL> PRINT, TAG_NAMES(STR)
SLIT_ID XTOP YTOP........ROW_9

I want to print value of ith tag of STR without mentioning the
Tag name. Can any one help??

can I do something like this?
IDL> print,STR.(ith_tag_name)
Re: IDL structure problem [message #93630 is a reply to message #93629] Wed, 14 September 2016 02:22 Go to previous messageGo to next message
Markus Schmassmann is currently offline  Markus Schmassmann
Messages: 129
Registered: April 2016
Senior Member
On 09/14/2016 09:16 AM, Sapna Mishra wrote:
> I have a structure STR which has 43 tags.
> IDL> print,N_tags(STR)
> 43
>
> IDL> PRINT, TAG_NAMES(STR)
> SLIT_ID XTOP YTOP........ROW_9
>
> I want to print value of ith tag of STR without mentioning the
> Tag name. Can any one help??
>
> can I do something like this?
> IDL> print,STR.(ith_tag_name)

A tag can be referenced using its index rather than its tag name. The
tag index should be enclosed in parentheses, as follows:

Variable_Name.(Tag_Index)... ... ...

The Tag_Index ranges from zero to the number of fields minus one.

Note: The Tag_Index is an expression, the result of which is taken to be
a tag position. In order for the IDL parser to understand that this is
the case, you must enclose the Tag_Index in parentheses. This is not an
array indexing operation, so the use of square brackets [ ] is not
allowed in this context.

[1] http://www.harrisgeospatial.com/docs/Structure_References.ht ml
Re: IDL structure problem [message #93634 is a reply to message #93630] Wed, 14 September 2016 08:15 Go to previous message
Sapna Mishra is currently offline  Sapna Mishra
Messages: 66
Registered: December 2015
Member
On Wednesday, September 14, 2016 at 2:52:17 PM UTC+5:30, Markus Schmassmann wrote:
> On 09/14/2016 09:16 AM, Sapna Mishra wrote:
>> I have a structure STR which has 43 tags.
>> IDL> print,N_tags(STR)
>> 43
>>
>> IDL> PRINT, TAG_NAMES(STR)
>> SLIT_ID XTOP YTOP........ROW_9
>>
>> I want to print value of ith tag of STR without mentioning the
>> Tag name. Can any one help??
>>
>> can I do something like this?
>> IDL> print,STR.(ith_tag_name)
>
> A tag can be referenced using its index rather than its tag name. The
> tag index should be enclosed in parentheses, as follows:
>
> Variable_Name.(Tag_Index)... ... ...
>
> The Tag_Index ranges from zero to the number of fields minus one.
>
> Note: The Tag_Index is an expression, the result of which is taken to be
> a tag position. In order for the IDL parser to understand that this is
> the case, you must enclose the Tag_Index in parentheses. This is not an
> array indexing operation, so the use of square brackets [ ] is not
> allowed in this context.
>
> [1] http://www.harrisgeospatial.com/docs/Structure_References.ht ml

Thanks Markus, it helps...
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Fitting curve to data
Next Topic: help needed in understanding correl_images

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

Current Time: Wed Oct 08 09:18:34 PDT 2025

Total time taken to generate the page: 0.00441 seconds