Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP 9 Wish - Opion explicit
Message
From
17/07/2003 05:06:26
Eyvind W. Axelsen
Profdoc Norge As
Oslo, Norway
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00810703
Message ID:
00810996
Views:
3
One problem with implementing this would be that VFP uses what is called a dynamic scope. What this means is that it cannot be known at compile-time which variables will be declared at any given point in a program. This is due to the private variables. For example, consider this legal program:

PROCEDURE Scope1
PRIVATE cTest
cTest = "Testing Scope"
Scope2()
ENDPROC

PROCEDURE Scope2
WAIT WINDOW cTest
ENDPROC

This would work just fine. However, if the procedure calling Scope2 did not define the variable cTest, then the program would fail. There is, obviously, no way for the compiler to know the order of procedure calls during runtime execution.

So, if one were to introduce something like option explicit in fox, one would also have to let the private (and public as well?) variables go, in my opinion.

Any thoughts on this?

Regards,

Eyvind.
Previous
Reply
Map
View

Click here to load this message in the networking platform