Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Different between private and local
Message
From
01/11/2000 13:28:43
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00436575
Message ID:
00436785
Views:
20
>Jasper,
>
>The difference is whether routines called from the one creating the variable can manipulate the variable. Unlike what others have said, there IS a variable scope of Private and it is different from Local. The PRIVATE command does NOT create variables, however a variable created by assigning it a value will have the Private scope. For example;
>
>
>LOCAL LocalVar
>LocalVar = "ABC"
>PrivateVar = "ABC"
>
>DO Level2
>
>? Level2LocalVar && Error Variable does not exist because it was local to Level2
>RETURN
>
>PROCEDURE Level2
>LOCAL Level2LocalVar
>Level2LocalVar = "XYZ"
>
>? LocalVar && Error Variable does not exist
>? PrivateVar && No error and value displays
>
>RETURN
>

'Unlike what others have said..' ? Am I missing something ?
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform