Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Interview question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01543887
Message ID:
01543956
Vues:
54
>>>>>*Interview question
>>>>>
>>>>>"PubVar" public variable is declared in the main prg.
>>>>>
>>>>>Public PubVar
>>>>>PubVar=2
>>>>>
>>>>>
>>>>>Then the subroutine prg is called. How to make PubVar hidden and not accessible there?
>>>>
>>>>
>>>>Public PubVar
>>>>PubVar=2
>>>>subroutine()
>>>>
>>>>PROCEDURE subroutine
>>>>WAIT WINDOWS m.PubVar
>>>>PRIVATE PubVar
>>>>WAIT WINDOWS m.PubVar
>>>>
>>>>ENDPROC
>>>>
>>>
>>>It is not a clean solution.
>>>After subprocedure header, and before private variable is declared, public variable is not hidden and it is accessible.
>>
>>
>>Then make it private before you call subroutine
>>
>>
>>	Public PubVar
>>	PubVar=2
>>	PRIVATE PubVar
>>	subroutine()
>>
>>PROCEDURE subroutine
>>
>>WAIT WINDOWS m.PubVar
>>
>>
>
>No, it means that you do not have Public variable anymore.

RELEASE
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform