Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting Problem with Controls on Form

Status
Not open for further replies.

ChasBoots

MIS
Jul 23, 2002
24
US
I have an odd problem that I hope someone can explain or offer a way in which to correct it.

I have a listbox control that stores the results of a search in an ascending order. As the listbox is populated, I am also creating an array that is populated with similar data. However, the sort order between the 2 differs when the text includes whitespace.

For example, my listbox would appear as follows:
AS400-06SBY
AS400-08SBY
AS400-10
AS400-8
AS400-Australia
AS400-Chester
AS400-Syracuse
AS400 Canada Dev
AS400 Canada Prod

However, my array would sort with the last 2 entries at the top. I even tried to to replace the array with a ListView control but have the same results as the array.

Since the hyphen is ASCII 45 and the whitespace is ASCII 32, I am unclear as to why the sort of my listbox would be incorrect. All sorting is handled by each control's SORT method and each control is updated once the search is completed.

Thanks for any help....
 
The data is accessed through an SDK that includes a full set of properties and methods for extracting the data. Unfortunately the database is in a format such that it cannot be queried.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top