Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Foxpro Problem - By Design
Message
From
18/10/1999 17:39:36
 
 
To
18/10/1999 11:21:41
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00277692
Message ID:
00277896
Views:
28
>While debugging some software, I noticed a strange behavior. My datasessions refused to change when I issued "set datasession to x". So, I looked in the MS Knowledge Base. Article number Q191316 states that this behavior is "by design". I beg everyone to take a look at this article. Other than not calling the method from the _SCREEN object, can anyone think of a work around? Any help would be appreciated.
>
>Thanks

You'll see incarcations of this behavior all over VFP. The reason is that code running from an object that sets a datasession, sets it in the context of that object's containership. If you place a button on a form that changes the datasession, it changes the datasession in that form. If you go to another form, get a reference to the first form, and call the click method of the
button, you will change the datasession for the first form, not the calling form. So as far as datasession settings go, objects are loyal to their containership, not to the call stack.

This is necessary behavior. Imagine if it were the other way around: two private DS forms, one calls code in another that changes the datasession, ;
and it changes the datasession for the calling form. What now for the button? What datasession is the rest of the code in the button in? ;
Did a single call change datasessions for two different private DSs? The way that it works now might be inconvenient for some design attempts,
but in the long run, it keeps things much simpler.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform