Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The Great ESC?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00209813
Message ID:
00209976
Vues:
33
Steve,

In order to react to a button press in a tight loop you must issue a DoEvents statement inside the loop. This function is horribly slow (on the order of 0.25 seconds per call) so it should not be issued every iteration. There is a class on my website that wraps this with a counter to work around the problem.

If you set the button's Cancel property = .t. when the button is clicked LASTKEY() will return 27.

>I have a program running in a continous loop on purpose. I want a button on my form to act almost like "Pressing the ESC key" to interrupt the program that's in the continuous loop.
>
>Is there a way to do it without getting the VFP error dialog box that says, "Cancel, Suspend, Ignore, etc." when you press the ESC key?
>
>I guess I can use the CHR() with ESC character code to cause the interrupt to occur, but I don't want the VFP error that follows. Can I trap the error before it is displayed and not show it?
>
>Thanks for your help in The Great ESC.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform