Information générale
Catégorie:
Codage, syntaxe et commandes
>>Specify an include file for the form that has READONLY defined
>>as a compile-time constant. eg #DEFINE READONLY -1
>
>You can hose yourself in plenty of different ways by being careless about the names that you give Compile time constants. Any time you create a constant with the same name as a VFP keyword, oyu run the risk of your constant value being used instead of the keyword when your code is compiled.
>
>Lesson? DON'T USE VFP KEYWORDS as CONSTANTS. (or variables for that matter).
I wish it were that simple. This error will also occur when
you use a non-keyword constant and an object within the same scope
has a property with matching name.
#DEFINE foo .T.
THISFORM.foo = 1 &&causes an error
I'm well aware of the fact that using reserved words as variables/arrays/whatever
will sooner or later get you in trouble. It just happened
that an include constant I copied form a help file was given
a name that belongs to VFP keywords.
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