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

Home » Public Forums » archive » Problem of precedence with pointer and 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
Problem of precedence with pointer and structure [message #47160] Fri, 27 January 2006 08:05
L. Testut is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: placing polylines/polygons exactly on a surface?
Next Topic: Re: Problem of precedence with pointer and structure

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

Current Time: Wed Oct 08 19:26:25 PDT 2025

Total time taken to generate the page: 0.00553 seconds