Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Public and local variable of the same name?
Message
From
16/01/2008 17:41:46
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01282432
Message ID:
01282433
Views:
16
I don't think so, since a local or public variable should hide a variable with the same name, coming from a higher level.

However, the recommended naming practice would avoid this situation entirely:
public goMyApp
goMyApp = createobj("MYAPPCLASS")

function MyFunct
local loMyApp
loMyApp = createobj("MYAPPCLASS")
return
Note that the first letter indicates the scope - g for "global" (public, can't use "p" since it is the same letter as private), l for "local". The second letter indicates the type of the variable, here, "o" for object.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform