Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Default LOCAL variable declaration
Message
From
29/10/2001 12:58:06
 
 
To
29/10/2001 12:44:07
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00574603
Message ID:
00574615
Views:
15
>For a long time now, I have had the impression that if you don't declare a variable in a function, it gets declared as a LOCAL the first time you use it. However, this does not seem to be the case...and I just noticed it when I started using VFP7. (I'm also working on some recursive functions)
>
>The following code illustrates the problem:
>
>
>func1()
>
>FUNCTION func1
>
> lcVar=[Fred]
> Func2()
> ?lcVar
>
>ENDFUNC
>
>FUNCTION func2
>    lcVar=[Barney]
>    lcVar2=[Wilma]
>ENDFUNC	
>
>
>
>lcVar in Func1 gets changed by the assignment in func2...if I declare the variable with a LOCAL, it works fine.
>
>So how DO variables get declared by default?
>
>Thanks
>Russ

PRIVATE
Previous
Reply
Map
View

Click here to load this message in the networking platform