General information
Category:
Forms & Form designer
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.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only