There is an old saying: garbage in and garbage out. This refers to users entering invalid data into a computerized system. Fortunately, we have some control over what users can input. This recipe shows you how this is done.
To restrict user input, perform the following steps:
Create a new main stack.
Drag a text input box to the stack's card.
Add the following code to the text input box:
on keyDown theKey if theKey is in "abcdefghijklmnopqrstuvwxyz" then pass keyDown else beep end if end keyDown
By evaluating the user's input prior to allowing it to pass to the next level in the message chain, we can selectively accept or reject it.