Thanks Rich -
It seems to me the loop counter should be LOCAL rather than PRIVATE. Is there a reason why you choose PRIVATE?
- Don
-btw It was a loop counter that cost me 3 hours yesterday.
>>Thanks Jim -
>>If an undeclared variable is PRIVATE by default, what is the point of the command? Can you give me an example?
>>
>>
>My second most favorite programming mistake........failing to make loop counters private
>
>DUMMY.PRG
>DIME abc[3]
>abc[1] = "dummy"
>abc[2] = "idiot"
>abc[3] = "genius"
>
>FOR I = 1 TO 10
> =FOO(abc[I])
>ENDFOR
>
>FUNCTION FOO
>PARAMETERS tcParam
>
>PRIVATE I
>
>FOR I = 1 TO LEN(tcParam)
> ? ASC(SUBSTR(tcParam,I,1)
>ENDFOR
>
>RETURN
>