Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to prevent datasession switching on global object ca
Message
From
11/07/2005 09:07:10
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, United States
 
 
To
11/07/2005 08:44:21
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 7
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01031168
Message ID:
01031180
Views:
16
Hi Andrus,
From the VFP 8 help -- SET DATASESSION typically is used to debug forms.
Previously I think that help said to use this command for debugging only. This 'switching' as you say, is what makes it possible to have multiple forms that encapsulate the tables they are dealing with. You can ask your global object for data and return it as an object, string, or array, but you can't just access the table from another dataSession -- and that's a good thing.


>I created global object g_server in default data session based on custom class.
>
>I call this object methods from prg files.
>I want that methods are executed in the caller datasession.
>However, FoxPro switches datasession to the session where g_server is created on call.
>
>I cannot pass datasession id as parameter since it is difficult to determine the datasession id (prg nesting is deep, this requires major re-write).
>
>Using
>
>SET DATASESSION TO (thisform.DataSessionId)
>
>causes error object is not contianed in form
>
>Using
>
>SET DATASESSION TO (_screen.activeform.DataSessionId)
>
>causes sometimes error _screen.activeform is not an object
>
>
>How to disable datasession switching when calling global object method ?
Charlie
Previous
Reply
Map
View

Click here to load this message in the networking platform