Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Interview question
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01543887
Message ID:
01543956
Views:
53
>>>>>*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.
Previous
Reply
Map
View

Click here to load this message in the networking platform