Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Forms and Datasessions...
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00146720
Message ID:
00167781
Vues:
30
>>>>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.


In regard to your comment , We have a prg in our project that opens tables in a datasession and have noticed this problem. What do you mean by 'external'? Does this common code need to be a method in the form, or would it work properly as a method in the app?

Thanks in advance for any assistance you might provide.
Nancy
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform