Hi John,

On Aug 1, 2006, at 5:53 AM, John Kubie wrote:

I don't know if this fits, but perhaps an alternative is not to sort in the listbox, but to sort using "sortwith". Each column would be a one-dimensional array. When the header is pressed, the press would be captured and that dimension would become the 'sort' column of the sort and all other dimensions become the 'sortwith' columns. After the sort you would re-populate the listbox. You would also have the arrays you desire.

Interesting approach, but I don't think it will work in this instance. You see. I'm working with an SQL cursor here; displaying the data in the listbox for a list view and in a form for a form view.

The problem, as I think, is that SQL does not 'normalize' activities; Sorting and Searching. They have to be done together instead of separately. Each time you want to re-order/re-sort the data, you have to do another SQL SELECT statement.

In order to avoid that, I just do one SQL SELECT statement and then sort the records based on their recID (initially) or their recID, as found in the re-sorted list, where the first column [hidden] is the recID number. I keep the data in a pair of arrays recIDs ; one for the records found in the SQL SELECT cursor and the other in the sort order determined by the end-user clicking on the header of the ListBox. In order to determine which data should be appearing in the form view—whenever the end-user double-clicks a row in the ListBox or clicks on one of the First-Next-Prev-Last buttons in the form view—I compare the sorted array to the SQL SELECT array to get which cursor positioned record should be seen.

It's more convoluted than I care for, but I think I prefer that to doing an SQL SELECT each time someone decides they want a different sort of an cursor's records. And I don't see the high-priests of SQL rethinking their failure to normalize processes any time soon.

If someone has an easier way of normalizing SQL events, I'd like to hear about it.

Regards,

Chuck_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to