Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Losing Public Variables When Form Runs
Message
From
25/06/1999 18:18:25
 
 
To
17/06/1999 20:28:10
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00231160
Message ID:
00234245
Views:
23
Have you tried using...

use table customer
scatter name ocustomer

This will create an object based on the current record of the table that can be referenced in the OOP world as follows:

to access a field from ocustomer object, use ocustomer.first_name etc...


>How and why do I lose public variables every time a form runs its default activate method?
>
>I'm trying to scatter memvar and have various object values set by the refresh method dependant on the value of those memory variables. I wrapped my head around why they should disappear when running any method - because they weren't public.
>
>So I wrote a quick routine which explicitly makes public all the memory variables before I issue the first 'Scatter'. This works but the now public variables disappear regardless when the form's activate method is called, and they don't reappear on return from that call. So they are still not available when the refresh methods are called to fix the values of the relevant objects on the form.
>
>I should point out that I'm doing this as a major exercise in converting a large 2.6 Dos application so I don't have the luxury of starting from scratch and achieving the same end in a different way (particularly by using data buffering rather than scattering). That'll have to come later. I should also point out that if I issue the scatter before the form is run (rather than as part of its load event) then I don't have the problem. I am, however, trying to take piecemeal advantage of the new way of doing things so I was trying to include that code with the form.
>
>Any guidance gratefully snatched!
>
>Harry
Thanks,

Stacy



Black Mountain Software, Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform