Re: Modifying Arrays and Structures in HASH's (hint: you can't) [message #85364 is a reply to message #85348] |
Mon, 29 July 2013 07:34   |
Bob[4]
Messages: 24 Registered: April 2009
|
Junior Member |
|
|
On Sunday, July 28, 2013 1:32:25 PM UTC-6, fawltyl...@gmail.com wrote:
> On Sunday, July 28, 2013 6:13:18 AM UTC+2, bobnn...@gmail.com wrote:
>
>
>
>> I will say that the inability of accessing directly into hashes and lists (by reference, not copy) is so disappointing that I am moving away from IDL. So if you found a way around this it would be very nice.
>
>
>
> LIST is a pointer array in disguise. You can get a copy of this array and manipulate list elements directly:
>
>
>
> IDL> l=list(1,2,3)
>
> IDL> a=l.idl_container::get(/all)
>
> IDL> print, l
>
> 1
>
> 2
>
> 3
>
> IDL> *a[1]=123
>
> IDL> print, l
>
> 1
>
> 123
>
> 3
>
>
>
> regards,
>
> Lajos
That is nice, but it is really for hashes that I want this behavior. This trick does not work for them.
As an aside I saw a list of future IDL features and Dictionary type was on it. Lets hope that this is implemented correctly and not with the crippled operator overloading system in IDL (like hash is).
Bob
|
|
|