Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Private Vars Declared in Init Scope
Message
 
To
16/12/2003 10:55:01
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00859506
Message ID:
00859515
Views:
12
This message has been marked as a message which has helped to the initial question of the thread.
Hi Tracy,

No, PRIVATE variables are visible only in procedures/methods where you created them and in all progs/methods called by the prog/method where you created PRIVATE variable (set aside the case when the called prog has the variables with the same name). When the prog/method that created PRIVATE variable finishes executing, it is automatically released. That's why in INIT() you need to assign your values to the form properties in order to keep them throughout the form's life.

>I thought all variables declared private in a form's init were supposed to be visible throughout the life of the form? Yet both variables created below do not exist after the init is exited and focus is on any object on the form.
>
>
>PRIVATE lvar1
>lvar1 = .T.
>
>DODEFAULT()
>
>PRIVATE lvar2
>lvar2 = .T.
>
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Reply
Map
View

Click here to load this message in the networking platform