Terry,
The parameters of a FOR loop are evaluated only once when the loop begins so only time saved would be on the second evaluation of the LEN(cName). I prefer to use the size of array directly.
FOR i=1 to ALEN(aLetters)
>Tore, perhaps you can advise me. I would have thought that:
>
>
cName = "Zakaria"
>lnLenCName = LEN( cName)
>DIMENSION aLetters( lnLenCName)
>FOR i = 1 to lnLenCName
> aLetters[ i] = SUBSTR( cName, i, 1)
> ? aLetters[ i] + CHR(13)
>ENDFOR
>
>would have been marginally faster (more so if a huge string), but at least more efficient, as LEN( cName) only has to be evaluated once, and not once then also every time through the loop. Perhaps this doesn't matter with for loops?
>
>Terry
>
>>Not much shorter, but a little:
>>cName = "Zakaria"
>>DIMENSION aLetters(LEN(cName))
>>FOR i=1 to LEN(cName)
>> aLetters[i] = SUBSTR(cName,i,1)
>>? aLetters[i] + CHR(13)
>>ENDFOR
>>
--sb--