Information générale
Catégorie:
Gestionnaire d'écran & Écrans
Hi Frank,
You're welcome. To help you understand what's going on, LastKey() return the ASCII code of the last key that was pressed. 27 is the ASCII equivalent of the escape key. When you assign Cancel = .T. in a command button, VFP will put 27 for LastKey() to pick up.
Now for the KEYBOARD/Inkey() part. Since LastKey() will keep it's current value until a key is pressed on the keyboard, you need to clear it so that if the user only clicked around, you won't still have 27 in it, like you had in your previous test. KEYBOARD Chr(255) will put a blank value in the keyboard buffer. To keep your control from getting this value, you call Inkey() to "eat" the dummy value.
Hope that clear a little bit the code.
>i tried the updated code in the beginning of the valid event. it works the way i wanted it to work. i cant say i totally understand but it works.
>thanks again for the help. youve been helpful in the past also.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement