Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Gotcha of the day
Message
De
26/11/1999 11:33:32
 
 
À
26/11/1999 10:45:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00295644
Message ID:
00295771
Vues:
18
>>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
Fil
Voir

Click here to load this message in the networking platform