IDL structure problem [message #93629] |
Wed, 14 September 2016 00:16  |
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 #93634 is a reply to message #93630] |
Wed, 14 September 2016 08:15  |
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...
|
|
|