How do I eliminate the spaceKey in a field?

Eric Chatonet eric.chatonet at sosmartsoftware.com
Wed Nov 16 17:08:52 EST 2005


Hi William,

Something as the following should do the trick:

on keyDown pKey
   if charToNum(pKey) <> 32 then pass keydown
end keyDown

Have a look at charToNum and NumtoChar very useful functions in the  
docs.
Hope this helps.

Best Regards from Paris,

Eric Chatonet.

Le 16 nov. 05 à 23:04, William de Smet a écrit :

> I am trying to limit the input into a field.
> Therefore I already used the returninField code but now I want to  
> block out the spacebarKey/spaceKey (don't know the English word)  
> because I don't want
> the user to put a space after a word.
>
> I've already looked at the RawKeyDown-  and KeysDown  function  but  
> I can't figure it out.
> Is it possible wat I want?
>
> So far I use the following code in the field:
> on returnInField
>    put line 1 of me into me
>    answer "Er mag maar één woord in dit veld!" with "OK"
> end returnInField
>
> on closeField
>    if return is in me then
>      returnInField
>    end if
>    pass closefield
> end closefield

----------------------------------------------------------------
So Smart Software

For institutions, companies and associations
Built-to-order applications: management, multimedia, internet, etc.
Windows, Mac OS and Linux... With the French touch

Free plugins and tutorials on my website
----------------------------------------------------------------
Web site        http://www.sosmartsoftware.com/
Email        eric.chatonet at sosmartsoftware.com/
Phone        33 (0)1 43 31 77 62
Mobile        33 (0)6 20 74 50 86
----------------------------------------------------------------




More information about the use-livecode mailing list