Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Forms and Datasessions...
Message
From
15/10/1998 16:29:03
 
 
To
15/10/1998 16:23:05
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00146720
Message ID:
00147233
Views:
25
>>>The problem with that is that there is already a READ EVENTS in effect by a global application object..any subsequent READ EVENTS have no effect...do all "modeless" forms revert back to the orginal READ EVENTS?
>>
>>Yes they do - a single READ EVENTS is sufficient for an entire application. Where are you calling your CLEAR EVENTS? This should only be called when your application is complete and you are shutting down.
>
>The CLEAR EVENTS is only being called on the shut down of the application. I should probably clarify a little...the form(s) are still present...the behavior in question that I really may have never noticed until now is that my "modeless" forms when activated seem to revert back to the "DEFAULT" datasession (the datasession instantiated at application start up)which is also at the same level as the "READ EVENTS". I'm converting over an application written in Fox 2.5 for Dos and where I'm running into trouble is that I took a lot of validation code written with "m." 's and changed them to the actual "table.fieldname" thinking that I can easily check the fields values for validation...etc. This would work, except on "modeless" forms which revert to the "Default" datasession, which in turn obviously goes "boom" when you query "table.fieldname" in a datasession that's not the current. Modal forms don't seem to have this problem..they keep their "private data sessions" as the current until
>released. Of course it would be easy for me to change the forms in question WindowType to "Modal", except these forms need use of the App's Menu which Modal forms , for obvious reasons, don't allow. So ANY suggestions short of changing the validation from field values, to the actual textbox values would be greatly appreciated.
>
>Thanks,
>
>sc

Where is your code for field validations? If its in a procedure file or in code that calls the form, you'll have problems accessing the private datasession for a form. VFP insists on changing the datasession for exteranl code to a form back to the default session. Its not recommended practice, but you COULD change the datasession in your external code (SET DATASESSION TO _SCREEN.ActiveForm.DataSessionID). If the validation code is part of the object on the form, you don't have the problem of the datasession being changed.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform