Sorting Text File for Highscores
Hi there, I recently created a program and want to add a highscore table to it.
I have 'Name', 'Score', 'Date' saving to text file (using append) and can then display this list in a label, however I want to sort the list to display the top 10 scores in the label.
Any help appreciated :)
Re: Sorting Text File for Highscores
What does your file look like? Can you post some sample data?
Re: Sorting Text File for Highscores
Quote:
Originally Posted by
CompSci_Joe
Hi there, I recently created a program and want to add a highscore table to it.
I have 'Name', 'Score', 'Date' saving to text file (using append) and can then display this list in a label, however I want to sort the list to display the top 10 scores in the label.
Any help appreciated :)
Isolate the scores when the file is read and as they are encountered, add the score strings to a list box with the sorted property set to True.
After the list box is built, remove any score after the 10th.