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

Home » Public Forums » archive » Is there any way to change the dimension of a field in a structure?
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
Is there any way to change the dimension of a field in a structure? [message #58155] Mon, 21 January 2008 22:11
Hongkai is currently offline  Hongkai
Messages: 6
Registered: September 2006
Junior Member
Hi folks,

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!

Hongkai
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL Workbench Starting Directory
Next Topic: Re: Is there any way to change the dimension of a field in a structure?

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

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

Total time taken to generate the page: 0.00581 seconds