Information générale
Catégorie:
Programmation Orientée Object
>One part of my app cycles three forms. Form 1 calls Form 2 then releases itself, and so on. Some of the tables are used in the data environment of all three forms. The problem is when Form 1 calls form 2 then releases itself, it closes all the tables in its DE, including the ones that exist in Form's 2 DE. This causes problems when methods try to access the now closed tables .
>
>Is this correct OOP behaviour, or is there a way for VFP to protect each form's DE (other than leaving all Form 1 tables open by disabling the auto close tables in Form 1 DE.)
If Form2 needs to work with tables opened by Form1, then it shouldn't open them itself. I wouldn´t include the Form1 tables in the Form2 DE. In fact, when I need to do these sort of things, I include no files whatsoever in the second form DE, and open files "by hand."
HTH!
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement