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

Home » Public Forums » archive » idl_conatiner::get and position
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
idl_conatiner::get and position [message #42768] Thu, 24 February 2005 13:58 Go to previous message
btt is currently offline  btt
Messages: 345
Registered: December 2000
Senior Member
Oh dear,

When GETting objects in a container the POSITION keyword specifies the location
of the objects needed. But they aren't returned in that order. They are
returned in the order they are stored (first in - first out).

Is there a way around this other than writing a method override?

Here's an example.

x = obj_new('idl_container')
for i = 0, 5 do x->Add, obj_new('idlgrmodel')

arr = x->Get(/all)
for i = 0, 5 do print, arr[i]

<ObjHeapVar847(IDLGRMODEL)> <<<< note the order
<ObjHeapVar849(IDLGRMODEL)>
<ObjHeapVar851(IDLGRMODEL)>
<ObjHeapVar853(IDLGRMODEL)>
<ObjHeapVar855(IDLGRMODEL)>
<ObjHeapVar857(IDLGRMODEL)>

y = x->get(position = [3,2,1]) <<<<< note the position order
for i = 0, 2 do print, y[i]

<ObjHeapVar849(IDLGRMODEL)> <<<< note the order
<ObjHeapVar851(IDLGRMODEL)>
<ObjHeapVar853(IDLGRMODEL)>


Any ideas?
Thanks,
Ben

{ ppc darwin unix Mac OS X 6.1.1 Oct 11 2004 32 32}
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: idl_conatiner::get and position
Next Topic: IDLgrPolygon image map scaling

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

Current Time: Fri Oct 10 07:30:21 PDT 2025

Total time taken to generate the page: 0.23843 seconds