Error in concatenating structure arrays [message #8892] |
Wed, 30 April 1997 00:00 |
Paul van Delst
Messages: 364 Registered: March 1997
|
Senior Member |
|
|
Hello,
I have a niggling problem with structure concatenation.
The following code :
pro test
as_state = { x0:-1L, y0:-1L, x1:-1L, y1:-1L, select:-1L, color:-1L }
info = { as_state : as_state }
dummy = { x0:2L, y0:2L, x1:2L, y1:2L, select:2L, color:2L }
info = { as_state : [ info.as_state, dummy ] }
help, info.as_state
end
gives the result :
% Conflicting data structures: DUMMY,MISSING.
% Execution halted at: TEST 6 test.pro
% $MAIN$
i.e. when I try to concatenate the structures, it fails.
The following code defines the dummy structure differently:
pro test
as_state = { x0:-1L, y0:-1L, x1:-1L, y1:-1L, select:-1L, color:-1L }
info = { as_state : as_state }
dummy = info.as_state
dummy.x0 = 2L
dummy.y0 = 2L
dummy.x1 = 2L
dummy.y1 = 2L
dummy.select = 2L
dummy.color = 2L
info = { as_state : [ info.as_state, dummy ] }
help, info.as_state
end
and works as expected with the result:
<Expression> STRUCT = -> <Anonymous> Array(2)
My question is: Why does the first method, where the dummy structure to
be concatenated is explicitly defined, not work? What does the error
message actually mean?
Thanks for your time,
Paul van Delst
|
|
|