This is a very simple VB6 project to part of a larger VB6 project. I just need some code to add-in.
I have attached this project a zip file containing 2 plain text files:
[login to view URL] [containing 89 entries]
[login to view URL] [containing a partial list of 4400 +/-]
Here is what I want. Create two list boxes, list1 and list2. In list 1 load [login to view URL], and in list2, load stars.txt. Simple so far. Here is where I need your help. In the last field of each line in [login to view URL] is the name of a constellation from list1.
A typical line in [login to view URL] looks like this:
12|166066|00 07 46.8|-22 30 32|5.94|55.56|-79.07|A2Vp:|Cetus
13|192367|00 08 03.5|-33 31 46|5.68|355.91|-78.67|K1III|Sculptor
14|128602|00 08 12.1|-02 26 52|6.07|98.34|-63.24|K2III+F|Pisces
15|73765|00 08 23.3|+29 05 26|2.06|111.73|-32.84|B8IVpMnHg|Andromeda
etc.... in the full list of about 9000+
Note they are "|| pipe separated for easy parsing.
Here is the idea: When someone clicks on any item from list1, the constellations, the code will grab ONLY those entries from [login to view URL] that have as the last field, just explained, the match to list1. IOW, if someone clicks in list1 "Pisces", then you will open list 2, grab only those lines that have as their last field "Pisces" and load them into list2. So now list 2 will ONLY show items from [login to view URL] that have "Pisces" as their last field.
Now here's the kicker: I need the list2 (the stars) to be randomly sorted each time the list is refreshed or load with the data. So if the end-user clicks on Pisces once, they get the list2 sorted randomly, and if they click Pisces again, the sort order in list2 will vastly differ from the first random sort of the Pisces entry.
In the first line of [login to view URL], you will note an entry before the constellations listings called "Best Available". In that case, and in that case only you will load the entire contents of [login to view URL] randomly sorted, so that the end-user will never get the same sort twice when choosing Best Available. Just like you did for the Pisces example.
If you have to randomly sort the data ten times in memory, that's fine, just make sure it is wildly sorted in list2. List1 never gets sorted. I want all sorting done fast :-)
## Deliverables
I require good code commenting so I can follow the code logic.