lnSecs = SECONDS() lnCount = 0 n = 0 lnBuffer = 3500 FOR n = 0 TO 9999999999 j = SUBSTR(m.lcString,(n*lnBuffer)+1,lnBuffer) lnLen = LEN(j) IF (lnLen < 1) EXIT ENDIF For lnX = 1 To lnLen lcVal = Substr(m.j,lnX,1) * lnCount = lnCount + 1 && to make sure it's getting hit the right amount of times! Endfor ENDFOR * 0.32 seconds ? "String Splitting: " + TRANSFORM( SECONDS() - lnSecs ) + " " + TRANSFORM(lnCount)Also playing around with the buffer size - looks like on my machine ~3500 chars seems to work best. Over 5000 it starts slowing down. Under 2,000 it slows down too although not much on that end.
>* 1mb string >Local lnX, lcString >lcString = Replicate("1234567890",100000) > >lnLength = Len(lcString) >? "Iterations: " + Transform(lnLength,"9,999,999") > > lnSecs = Seconds() > >FOR n = 0 TO 999 > j = SUBSTR(m.lcString,(n*1000)+1,1000) > For lnX = 1 To 1000 > lcVal = Substr(m.j,lnX,1) > Endfor >endfor > > ? "SUBSTR: " + Transform(Seconds() - lnSecs ) > >