Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Release
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01253375
Message ID:
01253560
Vues:
24
In addition to Dragan's response (thanks Dragan! :o), if you have only one form and you want the app to end when the form closes, then put the CLEAR EVENT in the form's destroy. You can also open the form with using the NAME clause and check for it's existence after your DO FORM line. If it doesn't exist, then issue CLEAR EVENTS there.

For example, PUT CLEAR EVENTS and llExit = .T. in the form's destroy, put this in the form's init:
*--Form Destroy
llExit = .T.
CLEAR EVENTS
*--Form Init
LPARAMETER llmycondition
IF !llmycondition
   llExit = .T.
   RETURN .F.
ENDIF
and this is your main.prg:
*--Main.Prg
llExit = .F.
DO FORM myform NAME omyform
DO WHILE !llExit

   IF TYPE('omyform') <> "O" or !ISNULL(omyform)
      llExit = .T.   
      CLEAR EVENTS
   ENDIF
   IF llExit
      Exit
   ENDIF
   READ EVENTS

ENDDO
Overkill, to be sure, but it works :o)






>>Why are you issuing RELEASE ALL and CLEAR EVENT? Is your app only a single form? Is the form modal? Normally, if you want to prevent a form from launching based on conditions in an app, you can check the conditions and return .f. from the form init to prevent the form from launching. However, the app will contain to run without a clear event. It depends on what you want to do specifically.
>>
>>
>>>>From the form init, just RETURN .F.
>>>
>>>Tracy do you mean like this?
>>>
>>>
>>>*at myform init event
>>>IF DATE()>CTOD("27/08/2007")
>>> MESSAGEBOX("wwwwwww")
>>> thisform.Release
>>> RELEASE ALL
>>> CLEAR EVENT
>>> RETURN .F.
>>>endif
>
>
>Hi Tracy:
>
>I can't speak for Mohammed, but now I'm confused...
>
>I jumped in here because I thought you might have answered a problem I have which is that sometimes in my simplest apps (a PRG calls a FORM and then follows it with a READ EVENTS and some cleanup and then exits, sometimes it leaves the form window open (in development mode -- of course it closes in compiled mode)... and I don't know why, since I CLEAR EVENT and thisform.release as the last two things under the "click" method of an "exit" button...
>
>Ah... oh... hmmm... maybe I need to put those somewhere other than click?
>
>Cheers,
>
>Kevin
>
>PS (Sorry if I hijacked this thread...)
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform