Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Class keeps changing DataSession
Message
From
01/08/2002 13:47:07
 
 
To
31/07/2002 20:58:00
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00684772
Message ID:
00685119
Views:
27
>>I have a sub-class that changes DataSession when a method is called.
>>The method in the sub-class does not exist in the parent-class, but the method that calls it does exist in the parent-class.
>>I don't instantiate the parent-class, just the sub-class. In the parent-class code I've tried specifically setting the DataSession to the one it's currently in, but when the sub-class code is called, the DataSession immediately changes to 1.
>>The Object is initially instantiated in DataSession 1, but I change to the proper one before calling the sub-class code.
>>This was originally working, but I was still improving it, and can't figure out what I could have done that caused it to quit working.
>
>The general rule (that I have observed many times, but don't remember finding it in the docs) is that any method will run in the datasession which was current when the object was created.
>
>IOW, if you want to have something that's datasession dependent, either instantiate it after the datasession is created, or pass the current datasession as an additional parameter to any methods that may need it, and set and restore the datasession as needed.

Hi Dragan,
That's what I'm doing. This is all in 1 object. The object is created in DataSession 1.
1. I pass "set('DataSession')" to a method in the object (grand-parent-code).
2. It sets the DataSession to the correct one (from DataSession 1).
3. It calls another method in the same object (grand-parent-code) (DataSession is still on correct one).
4. It calls a another method in same object (child-code) (DataSession is now on 1).
Bill Morris
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform