General information
Category:
Coding, syntax & commands
>>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only