Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataSession problem related to function keys - Is this a
Message
From
10/08/2000 16:14:16
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00403617
Message ID:
00403626
Views:
15
Hi Cathy,

Rethink this a bit :-) SET DATASESSION is not really supposed to be used to change the datasession. It will cause things to get goofy. This may be why the VFP docs say "SET DATASESSION is typically used to debug forms, and should not be issued when a form is active."

If you need that sort of functionality, try using a Session object. There is an article in the MS KB about using a Session to emulate a datasession.


>Is this a bug in VFP6 or am I doing something wrong?
>
>- Form A is modeless and has a private datasession. It has a button that invokes Form B.
>
>- Form B is modal and has a private datasession. It also has
ON KEY LABEL F2 DO junkprg
in the load method.
>
>- Junkprg is a program that, among other things, contains
SET DATASESSION TO (l_nvariable)
>
>I run Form A and press the button to invoke Form B. Then I press F2 to run the code that does a bunch of stuff, including changing the datasession. I've traced through the program and as soon as the SET DATASESSION TO command executes in the prg, the datasession of both Form A and Form B get popped to l_nvariable. I was anticipating that only Form B would get changed since that is the current _SCREEN.ActiveForm.
>
>I'm thinking this is a bug because if I call the PRG using a button instead of F2, only the datasession of Form B gets changed as I expected. Or if the F2 key invokes a method of Form B instead of a PRG, it also works as expected and only changes Form B. It's only when I use the combination of a function key calling a PRG that both datasessions get changed.
>
>Totally Confused!
>Cathy
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform