Sorting data

Submitted on: 6/27/2016 2:22:14 PM
By: George Sideris 
Level: Beginner
User Rating: By 1 Users
Compatibility: VB 5.0, VB 6.0, VB Script
Views: 4456
     How to easily Sort Data in a VB6 application as an operator keys data

				Often you need to collect some data while it is keyed and use it in a sorted order.
Yes, you can write any amount of data to a database file and retrieve it Sorted, but thats a rather lengthy overkill.
Here is Sorting the simple way.
1) Add a Listbox to your project - set the Sorted Property to True - Visible Property to False
2) Add what needs to be sorted to the Listbox
3) Read the data from the Listbox as required from top to bottom - it will be sorted !
Example use of this could be to group the products in a sales transaction into Stock Code order, or Bin Location Order for Picking purposes, etc
Sometimes you need a code and its original sequence to be sorted by code
Here I concatenate the values - Code, Sequence using a comma seperator
Its a very simple concept but works very simply and is easy to debug by turning the Listbox Visible property to True

Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)

Other User Comments

 There are no comments on this submission.

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)

To post feedback, first please login.