>Hi George,
>
>I've run a number of tests now and agree with your conclusion.
lcresult = SUBSTR(lcfoo, lni, 1) + lcresult
is faster than
lcresult = lcresult + SUBSTR(lcfoo, lni, 1)
The iteration structure doesn't seem to have an affect.
>In any case, they are both FAST!
Oh yeah. If the truth be known, I was just being a wise guy with my buddy John. That was the reason for my original post.
On the serious side of this, personally, given what's going on, I, quite frankly can't see any reason for one being faster than the other. In fact, I'm rather surprised at the result. About the only thing that makes any sense here is that in case 1 (lcresult = lcresult + SUBSTR(lcfoo, lni, 1) that there is more memory management to be done. IOW, the amount allocated for the string has to be changed and stored. In case 2 (lcresult = SUBSTR(lcfoo, lni, 1) + lcresult), it may be that a new area of memory is used and the pointer simply switched. This, however, a big time
SWAG and it could very well be something else.
George
Ubi caritas et amor, deus ibi est