Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get un-stuck from never ending QueryUnload loop
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00480846
Message ID:
00480868
Vues:
7
Hi!

No, all is right by design. When you close form -> it launches QueryUnload -> It clears events -> code immediately after Read events statement fires -> when it is finishing VFP, it cause close of all forms -> it causes launching of QueryUnload again

Put CLEAR EVENTS in the destroy event of your main form.

You can close any or all forms manually by following way:
for i=1 to _Screen.FormCount
  if _Screen.forms[i].Name = 'MyChildFormName'
    _Screen.forms[i].Release
  endif
endfor
In above loop you can close any form. You can even improve it to call QueryUnload of every form manually in separate loop before close and check if they all return .T. to disallow close of application in case some data not saved (or user cancelled saving prompt).

HTH.

>First time i tried this:
>A main form (As top level form) with an "X" button close (also has ocx status bar in container)
>A modeless child form (In top level form) opened with NoShow (also has ocx Tool bar in container). Menu select toggles show!
>The main form queryunload issues a call to a procedure with a clear events. It seems the program just cycles through the queryunload of child form.
>I used to believe that a simple MyForm.Release could close a form and any contained references. I wish I understood what was going on. How can an "X" button close any open (contained) forms and return to system.
>
>Is the close "X" button sick?
>AHA - Terry
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform