Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Thisform.INIT variable scoping
Message
From
02/05/2007 13:29:08
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
 
To
02/05/2007 13:21:19
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01221866
Message ID:
01221882
Views:
17
I knew someone would ask that... I need to save the value as it is first set when the form is created so I can revert back to it under a certain condition. There are various levels of classes, PRGs and form code that intertwine to make this a little more difficult than it seems on first glance. But, I used the form properties and they worked great. Thanks!

>Then definitely create a form property and set its value right after the value is set on the form object. Question though, why can't you just reference the value of the form object instead of creating a variable at all or creating another form property? What are you going to do with the value once you get it that you need a separate variable for?
>
>>Thought of that, but in the Load the member's have not been created yet, right? I need to reference a value on one of the form's objects. I want to do it in the best place that it will only be set one time when the form is run.
>>
>>>Nope. Put it in the load of the form, but better, create a form property and use it instead.
>>>
>>>
>>>>Been out of work or working so much in old FPW that I have forgotten this. I set a variable in the INIT of a form and it is then out of scope when the INIT is exited. I thought if I set it in the INIT it would remain in scope for all of the form's members. Thanks!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform