Information générale
Catégorie:
Codage, syntaxe et commandes
>You're right about this occurring in VFP 7.0, but not it 8. I was able to workaround the problem by placing the LOCAL reference to lnX on a separate line. Apparently, when used with data type declarations in 7.0, the LOCAL keyword is ignored and the variable becomes private. This short circiuts the loop counter. Alternate workaround would be to use different variable names, but that becomes a real PITA.
I did some more testing, and I think that I found the problem. VFP 7 does not process any variables in LOCAL statement after an ARRAY that is strong typed. For example, in the following command...
LOCAL lnBef AS INTEGER, lcBef AS CHARACTER, laOne(1) AS CHARACTER, lnAft AS INTEGER, lcAft AS CHARACTER
...only the lnBef, lcBef, and laOne variables are created. The lnAft and lcAft are not created until the first time they are used, and thus are created as privates. If I remove the AS clause for the array, everything is ok. Lesson learned, do not strong type array's in VFP 7.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement