Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Understanding public object and Data Session
Message
 
 
To
24/05/2008 11:35:33
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01319198
Message ID:
01319375
Views:
14
>>>http://fox.wikis.com/wc.dll?Wiki~DataSession
>>
>>Thank you, Frank.
>
>rule e) of that wiki article is your way out normally.
>
>Eg you have some application object goApp which is started in the public/general datasession 1.
>It offers seom method creating a cursor you may need in several places, eg a list of users. You'd need this cursor to be created in the private datasesson you call from, then add a method setDatasession to your
>App class, simply:
>
>
LPARAMETERS tnSession
>SET DATASESSION TO tnSession
>
>In the calling session do goApp.setdatasession(SET('DATASESSION')) before making the call creating a cursor and you're done.
>
>You may also want a resetdatasession() method, which resets an object to the datasession it was created, then simply store SET('DATASESSION') to some property in the init() event.
>
>Be cautious, I'd never change a form's session, that causes problems with bound controls, I'd just recommend that for classes tht act as some kind of library of methods you need in many places.
>
>You could also make use of functions, that always work in the same datasession as their caller.
>
>Bye, Olaf.

Thank you very much for your input, Olaf.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform