Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > IDL > Is there any wa...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 206 of 225
Post > Topic >>

Is there any way to change the dimension of a field in a structure?

by Hongkai <wang.hongkai@[EMAIL PROTECTED] > Jan 20, 2008 at 07:15 AM

Hi,

      I've been trying to change the dimension of a field in a
structure, like the followings:

S = {Dog:lindgen(3,112), Cat:'cc', Horse:[1,2,4]}
S.Dog = lindgen(3,118)

I got this:
'Conflicting data structures: structure tag,<LONG      Array[3,
118]>.'

This is reasonable because IDL dose not allow to change the dimensions
of the fields in the structure.

I can solve this problem by redefining another structure S1 with the
same tag names of S:
S1 = {Dog:lindgen(3,118), Cat:'cc', Horse:[1,2,4]}
S = S1

However, the question is, if I only know the tag name of the field
Dog, and I don't know the tag names of other fields in S,  how can I
change  the dimension of Dog?

I've tried this:
aa = tag_names(S1)
S = {aa(0):lindgen(3,118), aa(1):S.(1),a a(2):S.(2)}

but this only got a syntax error !

Thanks!
 




 3 Posts in Topic:
Is there any way to change the dimension of a field in a structu
Hongkai <wang.hongkai@  2008-01-20 07:15:42 
Re: Is there any way to change the dimension of a field in a str
Jean H <jghasban@[EMAI  2008-01-21 14:50:05 
Re: Is there any way to change the dimension of a field in a
Hongkai <wang.hongkai@  2008-01-21 18:52:02 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 9 6:20:00 CDT 2008.