Problem of precedence with pointer and structure [message #47160] |
Fri, 27 January 2006 08:05 |
L. Testut
Messages: 16 Registered: January 2006
|
Junior Member |
|
|
Hi everybody,
Here is my problem :
; If i define a is a 3 elements array of structure with two fields b
and c
; each field is an array
a=replicate({b:findgen(10),c:findgen(20)},3)
; and I want to replace the first field b with the constant value 0.5
; for the complete array structure, I write:
IDL> a[*].(0)=0.5 ;or a[*].b=0.5 ; and it works
; Suppose i have now a 3 elements array of structure with two fields b
and c
; each field is *pointer* to an array
a=replicate({b:ptr_new(findgen(10)),c:ptr_new(findgen(20))}, 3)
Is it possible to do the same replacement as above ???
IDL> (*a[*].(0))=0.5 ;doesn't work
% Expression must be a scalar in this context: <POINTER Array[3]>.
% Execution halted at: $MAIN$ 1
Thanks,
Laurent
|
|
|