Found one of lexikos Flip(Str) functions and it does truly work nicely. It does what it is supposed to do, but when the string contains a two digit value (10) these digits are flipped too (01), which breaks the handling in my script. How would one go about to prevent that to happen and still flip the string upside down, resulting in (10, 9, 8, 7, 6, 5, 4, 3, 2, 1)? This should also apply to three digit values.
Code: Select all
FlipStr := "1, 2, 3, 4, 5, 6, 7, 8, 9, 10"
msgbox % Flip(FlipStr) ; Reverse the string order.
Flip(in) {
VarSetCapacity(out, n:=StrLen(in))
Loop %n%
out .= SubStr(in, n--, 1)
return out
}