Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cancel Button
Message
De
04/12/2000 02:51:29
 
 
À
03/12/2000 20:32:44
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Titre:
Divers
Thread ID:
00447090
Message ID:
00448701
Vues:
12
>>>>In a FoxPro 2.6 Windows application, when start a program that could run a long time, how do you interrupt the program by pushing a "Cancel Button" ?, I do not know what to check for when the cancel button is pushed.
>>>>
>>>>Thanks in advance
>>>
>>>Pushing the Cancel button, provided it has the \? string in it's setting, will set lastkey() to 27 ie it's as if the escape key is pressed. You must have the prompt defined as say "\?Cancel"
>>>HTH
>>
>>Don't think that will work. FPW won't process the event while code is running. I think you'd have to put a CHRSAW() inside the loop, or something like that.
>
>You can't push a button while the code is running either. You need to use an ON KEY command.

Not entirely true. You can use an INKEY() call to get a key (or a mouse click) like this:
FOR x=1 TO 100000
  IF INKEY(.01,"mh")>0   && Check for a mouse click or a key press
    EXIT
  ENDIF
  *
  * other code here
  *
ENDFOR
?x
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform