Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Private DataSession persists after Form close
Message
From
23/11/1998 05:16:16
 
 
To
23/11/1998 02:10:50
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00160084
Message ID:
00160419
Views:
14
>David,
>
>>An object of takes on the data session that is current at the time of creation. So the object grabs a handle on "dataenvironment" which does not disappear until the last thing hanging on to it is released.
>>
>Like to clarify with you : if the DE is not used (instead, open files in Load), is the handle grabbed too?
>
Whatever datasession is in effect. The initial default datasession (0) is always available and will be current if and only if the form has "default datasession" and the datasession in effect when the form instantiated was the default.
>
>
>>BTW this makes object procedures fairly tricky, because they only see the one dataenvironment. Personally I like to keep procedures that generically handle data files in a procedure library (the old fashioned way), where they see the current data session, rather than in a object, such as the application object.
>>
>>>All objects have to be released, not just the form closed. Release oRef, and the DS should close. Be careful when using public variables, this behavior can occur.
>
>Actually, it was a toolbar that needed to stay on after the form is closed, and used in other forms too. The toolbar does not access files (not navigation). I had to work around this by 1st instantiating trhe TB prior to entry.
>
>So, I suppose this is a standard thing.

Yep, it's normal practice for the toolbar to call methods in the currently active form, _screen.activeform.save() for example. This way you don't have problems with the datasession and you share the toolbar amongst most or all of your forms.

>
>THanks, Ed, David.
Previous
Reply
Map
View

Click here to load this message in the networking platform