Post by just me » 02 May 2019, 10:51
Wenn das Ganze nicht zu groß wird:
Code: Select all
#NoEnv
Liste =
(
Gelb
Rot
Grün
Blau
Braun
Rot
Blau
)
Sorted := Liste
Sort, Sorted, CL
Array := StrSplit(RTrim(Sorted, "`r`n"), "`n", "`r")
I := 1
M := Array.Length()
Mehrfach := []
Mehrfach.SetCapacity(M)
While (I < M) {
Item := Array[I]
Count := 1
While (I < M) {
If (Item == Array[++I])
Count++
Else
Break
}
If (Count > 1)
Mehrfach.Push({Item: Item, Count: Count})
}
Sorted := ""
Array := ""
For Each, Treffer In Mehrfach
MsgBox, % Treffer.Item . " -> " . Treffer.Count
ExitApp
Wenn das Ganze nicht zu groß wird:
[code]#NoEnv
Liste =
(
Gelb
Rot
Grün
Blau
Braun
Rot
Blau
)
Sorted := Liste
Sort, Sorted, CL
Array := StrSplit(RTrim(Sorted, "`r`n"), "`n", "`r")
I := 1
M := Array.Length()
Mehrfach := []
Mehrfach.SetCapacity(M)
While (I < M) {
Item := Array[I]
Count := 1
While (I < M) {
If (Item == Array[++I])
Count++
Else
Break
}
If (Count > 1)
Mehrfach.Push({Item: Item, Count: Count})
}
Sorted := ""
Array := ""
For Each, Treffer In Mehrfach
MsgBox, % Treffer.Item . " -> " . Treffer.Count
ExitApp[/code]