(12-04-2022, 01:48 PM)SMcNeill Wrote: A better solution, in a case like this, is to minimize the usage of that slow processing string command, as much as possible.
Code: (Select All)DIM tempArray(UBOUND(Array)) AS STRING
FOR i = 0 TO UBOUND(Array)
tempArray(i) = LCASE$(Array(i))
NEXT
FOR x = 0 TO UBOUND(tempArray)
FOR y = 0 TO UBOUND(tempArray)
IF tempArray(x) < tempArray(y) THEN SWAP tempArray(x), tempArray(y)
NEXT
NEXT
FOR i = 0 TO UBOUND(Array)
Array(i) = tempArray(i)
NEXT
Surely this is a good opportunity to use _StriCmp to keep the code neat while still achieving good performance?
Code: (Select All)
For x = 0 To UBound(Array)
For y = 0 To UBound(Array)
If _StriCmp(Array(x), Array(y)) = -1 Then Swap Array(x), Array(y)
Next
Next