Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to release a form
Message
De
20/09/2009 11:56:52
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01425336
Message ID:
01425340
Vues:
68
>>>Hi,
>>>
>>>I have a form and in one of the methods of this form I want to release this form (based on some condition). So I have code
>>>
>>>thisform.release()
>>>
>>>
>>>But the form is not released. The program goes to the next line after the thisform.release(). How do I release a form in a middle of any method of the form?
>>
>>
>>Add a return after thisform.release() ?
>>
>>>
>>>thisform.release()
>>return
>>>
>
>Hi Gregory,
>
>I do have a return right after the thisform.release() but still the program goes to the method that called this message with .release(). There got to be something else missing. Thank you for the suggestion.


Hi Dmitry,

Yes, this is - say - by design

I see two possibilities - There may be better ways - I do not see any at this moment

(1) You can try "return to master" - I have not tested this
= m.thisform.Release()
return to master
(2) The calling hierarchy has to be made aware that the form is being released



You can add code to your form's baseclass.Release()
- add a propertery to the base class: Releasing

&& baseclass.Release()
this.Releasing = .t.
return DoDefault()
But each calling method would have to test
say
- func1
     - func2
         func3

= m.this.func1()
 if( m.this.Releasing )
         return

** func1
= m.this.func2()
if( m.this.Releasing )
   return

&& func2
= m.this.func3)
if( m.this.Releasing )
   return


&& func3

if( ... )
   =m.this.Release()
   return

 
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform