Quiz: String performance optimization
This code takes .03 seconds to run on my computer Try running it on yours.
ns=SECONDS()
x=""
FOR i = 1 TO 30000
x=x+"OneTwoThree"
ENDFOR
?SECONDS()-ns
?LEN(x)
Modified slightly, it takes 15 seconds. That's 500 times slower!
ns=SECONDS()
x=""
FOR i = 1 TO 30000
x="OneTwoThree"+x
ENDFOR
?SECONDS()-ns
?LEN(x)
I
Why the difference?