Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The Great ESC?
Message
De
24/04/1999 15:38:01
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00209813
Message ID:
00211920
Vues:
29
>>This has the same not-so-subtle bug as my example; if the table is empty, the INKEY() is never evaluated.. In addition, the scan continues to EOF if the Esc key is pressed, rather than aborting immediately.
>>
>>>Sincerely,
>
>Try modified version:
>
>lIsRun = .T.
>DO WHILE lIsRun
> SCAN While lIsRun
> IF INKEY() = 27
> lIsRun = .F.
> ELSE
> ... my main code is here
> ENDIF
> ENDSCAN
> lIsRun = (Inkey()#27)
>ENDDO

This will work if there are two ESC characters in the keyboard buffers - one to be eaten by the inkey() within the Scan loop, and the other one for the inkey() in the Do While loop. It will suffice to change the last lines to
   ENDSCAN
   lIsRun = (Inkey()#27) and lIsRun && here we use the inner one
ENDDO

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform