Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Local vs private
Message
De
10/08/2005 11:24:23
 
 
À
09/08/2005 20:23:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01039725
Message ID:
01039878
Vues:
24
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
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform