Information générale
Catégorie:
Codage, syntaxe et commandes
>an optimal thing would be a new SET os SYS()
>that force VFP to does not search a variable without m. prefixe declared.
>SET MEMVARPREFIXNEED [ON|OFF] && defaul OFF
>* or
>SYS(someNumber,0|1) && default 0
Fabio,
For your information, in Clipper 5, the following keywords are handy and can be considered by the VFP team:
MEMVAR ListOfVariableNames
FIELD ListOfFieldNames [IN Alias]
Unaliased references to the names specified by MEMVAR will be assumed to be variables. Similarly, unaliased names specified by FIELD will be assumed to be fields.
In the old days when I was programming in Clipper Summer 87 and FoxBase, I (and most programmers at that time, I think) prefixed all variables with "m" (e.g. mStackLevel), since typing "M->" (equivalent to our "m.") is tedious. The new keyword MEMVAR in Clipper 5 did really make me happy since when we are writing library functions, most of the time we are dealing with only variables.
In FoxPro for DOS, I changed mStackLevel to m.stackLevel in order to save one precious character (only the first 10 characters of a variable name are significant in FPD). I kept such practice until I upgraded to VFP7. The new syntax colouring feature of VFP7 annoyed me because it highlights quite number of my variables in keyword colour. I started to prefix my variables with a data type identifier, e.g., m.nStackLevel.
Ben
Précédent
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