Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Local vs private
Message
From
10/08/2005 11:24:23
 
 
To
09/08/2005 20:23:14
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01039725
Message ID:
01039878
Views:
23
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
>&& Try it with and without the next line
>PRIVATE I
>
>FOR I = 1 TO LEN(tcParam)
>     ? ASC(SUBSTR(tcParam,I,1)
>ENDFOR
>
>RETURN
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform