[AccessD] sorting a list

Jim DeMarco Jdemarco at hshhp.org
Fri Apr 25 08:05:34 CDT 2003


Susan I don't know if you've solved this yet but I did write a "self-sorting" collection class a while back (uses a bubble sort IIRC).  Let me know if you'd like to see it and I'll dig it out for you.

Thanks,

Jim DeMarco
Director of Product Development
HealthSource/Hudson Health Plan


-----Original Message-----
From: Susan Harkins [mailto:harkins at iglou.com]
Sent: Monday, April 21, 2003 9:55 PM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] sorting a list 


Well, this was my thought too -- but I'm not sure you need to do all that
work Drew -- at least not for what I'm doing. The list will always change --
so I'd just be dumping the collection straight into a table -- it wouldn't
even matter if there were no objects in the collection and the collection
were empty. So, you think that would be faster than an array? I'm not sure
how to sort an array -- is there a property?

Susan H.


> If the data is already in a collection, you sure can sort it with a query.
> Build a query that pulls the data from a collection.  I posted an example
of
> how to do this before.  Here's the basics.  Build a function that
retrieves
> the data from the collection by it's index.  Then build a simple table
with
> a number field.  Build a function that retrieves the count of the
> collection.  Have 2 fields in the query, the first field is the field from
> the number field table.  Put the Collection count as the criteria (<=).
> Have that function not only return the count of the collection, but have
it
> check the size of the collection against the highest value in that table.
> If the table has less 'numbers' then the collection, add enough records
> (with consecutive numbers) to bring it up to par.  Then have the second
> field in the query return the value from the collection based on the index
> retrieved from the number table.  Then hide the first field and sort the
> second.  Whalla!
>
> Drew
>
> -----Original Message-----
> From: Susan Harkins [mailto:harkins at iglou.com]
> Sent: Monday, April 21, 2003 8:03 PM
> To: accessd at databaseadvisors.com
> Subject: Re: [AccessD] sorting a list
>
>
> Can't use a query -- I'm using a For Each to loop through a collection to
> get the list. I thought about filling a table with the list, but that
seems
> worst than sorting an array. Wonder which would be quicker?
>
> Susan H.
>
>
> > I'd say the easiest way is to switch it to a query, put the 'list' in a
> > table, and have the query sort it! <grin>
> >
> > If you must stick with a list, use split to put it into array, then dump
> it
> > into a collection (or just resort the array).  Then rebuild the string.
> Of
> > course I think this is a long way of doing things!
> >
> > Drew
> >
> > -----Original Message-----
> > From: Susan Harkins [mailto:harkins at iglou.com]
> > Sent: Monday, April 21, 2003 7:52 PM
> > To: AccessD at databaseadvisors.com
> > Subject: [AccessD] sorting a list
> >
> >
> > Anyone have an easy way to sort a list or combo control's list when
> working
> > with a Value List RowSourceType?
> >
> > Susan H.
> >
> > _______________________________________________
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> > _______________________________________________
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
> >
>
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>

_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


***********************************************************************************
"This electronic message is intended to be for the use only of the named recipient, and may contain information from Hudson Health Plan (HHP) that is confidential or privileged.  If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of the contents of this message is strictly prohibited.  If you have received this message in error or are not the named recipient, please notify us immediately, either by contacting the sender at the electronic mail address noted above or calling HHP at (914) 631-1611. If you are not the intended recipient, please do not forward this email to anyone, and delete and destroy all copies of this message.  Thank You".
***********************************************************************************



More information about the AccessD mailing list