Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Public and local variable of the same name?
Message
De
16/01/2008 17:41:46
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01282432
Message ID:
01282433
Vues:
17
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)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform