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

Home » Public Forums » archive » Re: array of objects?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: array of objects? [message #29276] Tue, 12 February 2002 09:22 Go to previous message
Pavel A. Romashkin is currently offline  Pavel A. Romashkin
Messages: 531
Registered: November 2000
Senior Member
Ted is correct. For creating an array of objects, you need to use OBJARR
function, then loop through the array and populate each element using
OBJ_NEW. What you have created in your code is 100 references to the
same object.
We talked before about the advantages of allowing definitions of object
arrays the same way as normal arrays are made, but the consensus was
that it is unsafe :( becasuse, say, one could populate an object array
with different object classes. Personally, I think it is not so and I'd
leave that decision to the programmer, but heap variable arrays are
slower a bit anyway, so none of the fast vector features of IDL would've
worked on them anyway.
HTH,
Pavel

Thomas Bielser wrote:
>
> ...but IDL comes up with:
>
> IDL> print, a[0] -> getproperty( /integer_value )
> 99
> IDL> print, a[50] -> getproperty( /integer_value )
> 99
> IDL> print, a[99] -> getproperty( /integer_value )
> 99
>
> Is this a feature or a bug? Many thanks in advance!
> Thomas
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Displaying bitmap pictures
Next Topic: Object method compiling

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

Current Time: Sat Oct 11 06:17:17 PDT 2025

Total time taken to generate the page: 1.67491 seconds