Hi Everyone,

can someone help me on this, i cant figure out how to 'correctly sort' an already 'sorted' listbox in VB6, with alphanumeric items

  • listbox when the Sort property set to TRUE have these values


data0
data1
data10
data19
data2
data22
data3
data31

  • i need to have a function that will SORT it correctly something like this


data0
data1
data2
data3
data10
data19
data22
data31

  • total listcount maybe around 5000 lines, and "data" is not constant


data0
data10
data2
dq0
dq10
dq2

  • i already tried searching the net for a solution but only available mostly on integers
  • and because ALL listbox used in my project was sorted by setting the SORT property to TRUE, i need to have at least input of the function with listbox sort property to TRUE

thanks
ariesL

Recommended Answers

All 2 Replies

Hi,

You need to Split the Text into 2 Parts, and then Sort it..
Numeric Part should be formatted with Appropriate Zeros in Between..
Data need to be like this:...

Data001
Data002
Data003
Data010
Data012
Data100

If you know how many distinct TextParts you have, Then
Loop thru the ListBox, And Format the Text Properly, and add to another list box..

Regards
Veena

Hi QVeen72,

I will try your suggestion

thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.