Information générale
Catégorie:
Codage, syntaxe et commandes
>>>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:
As I understand it, PRIVATE creates a shadow of the global variable which exists from that point forward in the call structure, but upon returning from whatever the context is (function, method, event), it goes out of scope and the original value defined PUBLIC is once again visible.
I don't view it as a compiler directive. In Visual FreePro, I had to add contextual variable lookups to support PRIVATE variables.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement