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:
00211302
Vues:
43
>David,
>
>I tried your suggestion for breaking out of an infinite loop. I must still be doing something wrong. Can you see anything wrong with this picture?
>
>I took one button on my form and named it cmdCloseWindow and set its Cancel property to .T. as you suggested. You mentioned that pressing the button would return a 27 which looks like an ESC key to me. But I believe I also SET ESCAPE OFF in the form Load procedure. Any ideas why it's not working to break out of the loop? That's all that is wrong with my form. Here's my code:
>
>DO WHILE .T.
> SCAN
> DOEVENTS()
> IF LASTKEY() = 27
> EXIT
> ENDIF
>... my main code is here
> ENDSCAN

You need TWO exits - one from the SCAN, and one from the DO WHILE, or you need a way to terminate the DO WHILE, like:
lExit = .F.
DO WHILE ! lExit
   GO TOP
   SCAN WHILE ! lExit
      * do what you want
      DOEVENTS()
      lExit = (LASTKEY() = 27)
   ENDSCAN
ENDDO
>ENDDO
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform