1=1
87=0
7=5
13=7
43=10
39=30
46=15
45=75
I want to get 7,43,39,46,45 (in different variables, like 7 be VAR1,43 VAR2) because these six numbers hold the largest key value
Help?

Code: Select all
IniRead, SectionText, test.ini, Test
Numbers := {}
Loop, Parse, SectionText, `n
{
StringSplit, Element, A_LoopField, =
Numbers[Element2] := Element1
}
For, Key, Value in Numbers
NumList .= Key "|"
Sort, NumList, N R D|
Ordered := StrSplit(NumList, "|")
; Results are in the array named Ordered. The following is just to output the list in a single MsgBox:
Loop, 6
TextOut .= Numbers[Ordered[A_Index]] ","
StringTrimRight, TextOut, TextOut, 1
MsgBox, %TextOut%