Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
_TALLY locality
Message
From
05/09/2019 18:05:09
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
 
 
To
05/09/2019 17:51:15
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01670635
Message ID:
01670640
Views:
64
>>I'm wondering if there isn't a PRIVATE type inheritance that occurs for events, where it doesn't occur for methods, such that on events the global variables are inherited from their current values, and they can be altered and manipulated in the event, but when the event returns the PRIVATE nature asserts itself so the original value before the event returns to each variable, and they are visible as they were before the events.

Don't think so. PRIVATE is really a compiler directive, not actually creating the variable unlike LOCAL or PUBLIC. Easy enough to demonstrate:
PRIVATE myvar
? myvar
If a (declared or by default) Private variable exists when a proc or function is called, it can be manipulated there unless passed as a parameter by value or declared local or private there. If the variable does not exist but is created in the called function or proc, by default it is created private to that sub-proc, so its value is lost at the end of the proc.
PRIVATE myvar
*---uncomment this to compare:
*---myvar=""
=Test()
? myvar

FUNCTION Test
myvar="I think, therefore I am."
"... They ne'er cared for us
yet: suffer us to famish, and their store-houses
crammed with grain; make edicts for usury, to
support usurers; repeal daily any wholesome act
established against the rich, and provide more
piercing statutes daily, to chain up and restrain
the poor. If the wars eat us not up, they will; and
there's all the love they bear us.
"
-- Shakespeare: Coriolanus, Act 1, scene 1
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform