Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Gotcha of the day
Message
From
26/11/1999 11:33:32
 
 
To
26/11/1999 10:45:39
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00295644
Message ID:
00295771
Views:
19
>>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform