Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Confusion over NULL
Message
De
22/05/2007 09:37:50
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
22/05/2007 09:25:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01203230
Message ID:
01227612
Vues:
21
>It's impossible in VFP to create a variable that doesn't have data type assigned to it. If data type is not specified the Logical data type is used as default.
>
>Not so. If you explicitly declare a variable as LOCAL, this is true. But if you do not explivitly decalre the cariable as LOCAL, VFP scopes it a PRIVATE by default. A private variable is not assigned any data type by default.

A note for those who are still unclear on the subject:

A private variable is not assigned any data type by default... because Private declaration doesn't create it, it just hides any already existing variable defined anywhere up the call stack, so if such a variable is created, it will not touch the one defined up there. But the moment it's created, it's created by this or that type of assignment (store, =, scatter) and then it'll have a type. It's usually tricky for newcomers to Fox, to understand that while Public and Local create a variable, Private doesn't. It's so for historical reasons, and stayed so for compatibility's sake (or else all the code which checked for existence of a private variable would fail).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform