about structures [message #86101] |
Thu, 03 October 2013 08:54  |
natha
Messages: 482 Registered: October 2007
|
Senior Member |
|
|
Hi guys,
If I create a structure like this:
IDL> a={lolo, a:0, b:''}
Is there a way to change the definition of the defined structure lolo?
What I mean is that, pe, I can do:
IDL> b={lolo}
IDL> help, b, /str
** Structure LOLO, 2 tags, length=24, data length=18:
A INT 0
B STRING ''
But what I cannot do is:
IDL> delvar, a
IDL> delvar, b
IDL> c={lolo, a:intarr(2), b:strarr(2)}
% Conflicting data structures: <INT Array[2]>,LOLO.
% Execution halted at: $MAIN$
I know that the definition of the structure lolo is stored somewhere and apparently it cannot be modified. If you know a way to re-define the contents of a previous created structure, please let me know...
Another thing; I do know that using "anonymous" structures I will not have this kind of problems.
I am just curios to see if this is possible...
Thank you in advance,
nata
|
|
|
Re: about structures [message #86102 is a reply to message #86101] |
Thu, 03 October 2013 09:10  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
nata writes:
> If I create a structure like this:
> IDL> a={lolo, a:0, b:''}
>
> Is there a way to change the definition of the defined structure lolo?
> What I mean is that, pe, I can do:
> IDL> b={lolo}
> IDL> help, b, /str
> ** Structure LOLO, 2 tags, length=24, data length=18:
> A INT 0
> B STRING ''
>
> But what I cannot do is:
> IDL> delvar, a
> IDL> delvar, b
> IDL> c={lolo, a:intarr(2), b:strarr(2)}
> % Conflicting data structures: <INT Array[2]>,LOLO.
> % Execution halted at: $MAIN$
>
> I know that the definition of the structure lolo is stored somewhere and apparently it cannot be modified. If you know a way to re-define the contents of a previous created structure, please let me know...
>
> Another thing; I do know that using "anonymous" structures I will not have this kind of problems.
> I am just curios to see if this is possible...
Not possible. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|