Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object and datasessions (again)
Message
From
22/07/1999 16:01:54
 
 
To
21/07/1999 19:03:32
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00244270
Message ID:
00244956
Views:
13
>>>Unless I am missing something, it seems to search in the datsession in which it was created.
>>
>>I don't think so. Honestly, I don't use private datasessions so my knowledge here is quite limited, but logically any external code should access current datasession.
>
>Alex is right. Objects always live in the datasession they were created in, unless they explicitly SET DATASESSION TO.
>
>Say I have a custom class that has a method that returns whether or not a certain table is open.
>
>USE MyTable
>oTest = CREATEOBJECT("Tester")
>?oTest.IsOpen() && Return .T.
>
>* Now, get a new datasession
>
>loSession = CREATEOBJECT("Session")
>SET DATASESSION TO (loSession.DataSessionID)
>?USED("Campus") && Returns .F., because it is open in the original datasession
>?oTest.IsOpen() && Return .T., because the Test object is still living in that datasession
>
>DEFINE CLASS Tester AS Custom
>PROCEDURE IsOpen
>RETURN USED("MyTable")
>ENDDEFINE

Ok, I make a note on this. You know that I don't use this stuff. It seems to me that this 'relation' between datasession and object is very confusing. I'm glad that I don't use it even more now :-).
Edward Pikman
Independent Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform