---- Irv wrote ----
> In your code, if the user types a symbol (pound sign for example 
> where the key = 35), it will fall through all your case tests and 
> land in the otherwise clause.  The code of the otherwise clause is 
> "pass".  Pass means to pass this key through to the field - which is 
> exactly what is happening.  If you do not want to pass such 
> characters, use "dontPassEvent"
> 
> One extra style comment.  Instead of repeating "chartonum(the key)" 
> in so many places, do it once at the top of you keydown handler, 
> assign the result to a local variable, then use the local variable 
> everywhere:
> 
>    keyValue = charToNum(the key)
>    case TRUE of
>      (keyValue = 13): -- RETURN
>         submitWord(me)
>      etc.
> 
> While the results will be unnoticable in such a short handler, it 
> does make the code more readable, and is a good tehnique will speed 
> up code in general.
> 
> Irv
-------------------

cheers Irv. I was a little unclear on the sequence of passing - your mail's cleared it 
up for me. (In my head) I was meaning for Director to ignore the event - guess I 
didn't read the pass description thoroughly enough. Like you said, "dontPassEvent" - 
which is "stopEvent" in Dir 8 - has done the trick and it works like a charm. 

As for the style - I usually bang out the code, then go back and optimize it once it 
works. Thanks for the tip though - it did look ugly to read when I look back at my own 
mail :)
  Since I figured that the user should have access to keys such as left, right, DELETE 
etc I've now made a list of allowed keys and use the case statement to check the key 
using a getone <> 0 statement. Works well. 

thanks for the help,

Leon



[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to