from what you explained, my guess is that the objects are created
already in a quasi-ascending order. Because of this, if you add them
to the collection as I suggested, it is best, when you add the object,
to find the entry point by traversing the collection starting from the
last element. It is much faster because almost always your object
will end up at the end.
m.
> -----Original Message-----
> From: Yoel Pedersen [SMTP:y.pedersen@g...]
> Sent: Friday, July 27, 2001 1:38 AM
> To: professional vb
> Subject: [pro_vb] RE: Getting items in collection, reversing order
>
> Hi,
>
> And thanks for your reply, all of you.
>
> I need the collection object for a chat application, where the message
> objects are stored in a collection residing in the server's memory. I am
> using ASP 3.0 with Windows 2000 A. S., and my goal is to make it run
> entirely in the memory of the server, without having to make any database
> searches. This way I think I could be able to increase the performance
> (it's just my guess though).
>
> As the messages collection will be browsed very often, I need to make the
> sort logic as simple as possible, to decrease the lack of performance.
>
> Cardying, having a virtual recordset sounds like an interesting idea
> because it would increase my abilities to order the objects as I want..it
> would just need a reconstruction of my chat application, so I will use it
> as a last way out.
>
> Marco, it sounds like a good idea to sort the objects before inserting
> them in the collection. It is my guess that this is closest to what I
> need...I will try it out and see if I can make it work.
>
> Once more, thanks for your invaluable help.
>
> Regards, Yoel
>