Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Option Explicit in VFP
Message
From
05/11/2000 13:24:59
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00437876
Message ID:
00438144
Views:
13
>>Not having access to the copy of VFP 7.0 that was distributed at DevCon, I can't say for certain that it's the same in VFP. However, I would say that, if invoked, an undeclared variable will generate an error at compile time.
>
>Unfortunately, no, it won't generate a compiler error. It only shows up at runtime.

And it seems to me that the VFP platform in general would be incapable of comprehensively generating a compile time error, because we still have macro substitution and the STORE command both of which can assign a value to a variable named in an expression

MyVar= "x" + "2"
&MyVar = 1
STORE 2 TO (MyVar)

Given these possibilities, it would seem impossible for the compiler to see when a value was being assigned to an undeclared varaible.

But that doesn't mean it couldn't watch for normal assignment statements and check for a LOCAL, PUBLIC, or LPARAMETERS command that initialized that variable.
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform