Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Confusion over NULL
Message
From
22/05/2007 09:37:50
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
22/05/2007 09:25:56
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01203230
Message ID:
01227612
Views:
24
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform