Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP 6.0 variable declares
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Conférences & événements
Divers
Thread ID:
00101472
Message ID:
00101805
Vues:
29
Costas,

Sorry, there is no compiler switch in VFP6 to warn you of ambiguous memory variables. I too wish MS provided this compiler switch.

In the old DOS Clipper compiler, there is a /W switch which would generate a warning message for any variable it could not resolve at compile time. For those PUBLIC or PRIVATE variables which were declared elsewhere, there was a "MEMVAR gVariable" statement you inserted in your code before the gVariable was referenced. This let the compiler know this is a variable you are aware of and not to generate a warning message. This is not the same a type checking on the variables. It just made sure they are declared. I always used this /W switch to keep my code as clean as it could (it didn't do any type checking).

FYI, there is a new SET STRICTDATE statement which will help you keep your date variables clean as it will warn you of ambiguous 2 digit year dates. This should help you keep your apps Y2K compliant.

I believe this is where VFP6 falls short compared to other compilers. A compiler which performs strict type checking of variables, and in general, can catch as many potential problems as possible at compiler time is a great asset in creating robust code. Of course, there will then have to be an option to disable these compiler options for backward compatibility and to keep it flexible. Then again, I really like how I can have an array with elements of any type.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform