Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Methodology question
Message
From
10/01/2001 12:00:45
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00461641
Message ID:
00461698
Views:
12
>Hi everybody,
>
>We're using our own framework. In this FrameWork we have two Form classes, both of them have some code in Load event, which sets several common settings, e.g.:
>set talk off
>set ansi on
>set exact on
>set multilocks on
>etc.
>
>Now, let's assume this situation, which happens in one of my application:
>One Form calls another form.
>The first form has private DS and the second has default in order to share calling form DS. In the first form I excplicilty set SET EXACT OFF, because I need it this way. The other form would override my settings in its Load event and even worse, the calling form now would have a wrong setting as well. What can you suggest to resolve this problem.

Best way, IMO, is to revert to the good old practice we had in procedural days: leave the things as you found them. So, for any form which has a public datasession and does change the settings:

in .Load, save the settings which could be changed, and (depending on what you want to do), call a method to set the new settings
in .activate, call a method to set the new settings
in .deactivate, call another method to restore the original settings

While you could set and restore the settings in .load and .unload (or .destroy), I'm still inclined to think that a separate pair of methods would be better - you may need to call them in a different context, depending on what you do on your form.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform