Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Clear events question
Message
De
08/09/2010 06:59:47
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
08/09/2010 05:21:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01480530
Message ID:
01480535
Vues:
63
>Hi
>
>I've installed an on error routine in an application.
>
>Its an old app that has a lot of errors and users are used to ignoring them. I've put in an ON ERROR routine so I can log the errors and iron out the worst offenders.
>
>In the on error routine I give the user the choice of carrying on or quitting.
>
>If they select quit I
>
>CLEAR EVENTS
>QUIT
>
>But sometimes when the users select quit they get Cannot Quit Visual Foxpro.
>
>I suspect there are paths through the system that may issue another READ EVENTS. Could this cause the problem above ? Are READ EVENTS nested ?
>
>Nick

This may not solve your problem, but it seems to me that the QUIT command is at the wrong place. You might not need it at all. Consider the READ EVENTS as a kind of "main loop" (an infinite loop) in your program; CLEAR EVENTS is used to break out of this loop. While the READ EVENTS is in effect, VIsual FoxPro will wait for user input, react to it (for example, in a button's Click() event), then go back to the READ EVENTS to wait for more input. When a CLEAR EVENTS is given, Visual FoxPro "breaks out of the READ loop", and continues with any cleanup commands you have after the READ EVENTS. A QUIT command is not even needed; but if you have one, I would expect it to be somewhere after the READ EVENTS command (immediately after, or after any desired cleanup).
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform