Android Question sort list

hookshy

Well-Known Member
Licensed User
Longtime User
I has some trouble in sorting the scores of a game using simple and yet complicated sort function of lists.
The sort function sorts correctly as long as all elements are same type : strings or number
The following code sorts the scores , that you could save aferwards on you sd card as list of strings.

B4X:
For i=0 To rank.Size-1

Dim temp As Int
temp=rank.Get(i)

rank.RemoveAt(i)
rank.InsertAt(i,temp)
Next


rank.Sort(True) 'sorts ascending the list

diplay_rank ' function to display the list
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…