Field Keyboard Functions
    J. Landman Gay 
    jacque at hyperactivesw.com
       
    Thu Dec  5 15:05:01 EST 2002
    
    
  
On 12/5/02 1:39 PM, FMoyer at aol.com wrote:
> My script is:
> 
> on controlkeydown what
>   put the shiftkey into s
>   put the optionkey into o
>   if what is in "HJKLI:;" then
>     case "J"
>       if s is down then
>         if o is down then
>           -- script to select text back a word
>         else
>           -- script to move cursor back a word
>         end if
>       else
>         if o is down then
>           -- script to select text back a character
>         else
>           -- script to move cursor back a character
>         end if    
>       end if
>       break
>     case "K"
> etc.
> 
> Any ideas what might be going wrong?
You are mixing up control structures. The "case" statement has to be 
part of a "switch" structure. It should be like this:
if what is in "HJKLI:;" then
   switch what -- need this
     case "J"
       -- stuff
       break
     case "K"
        -- stuff
        break
   end switch -- need this too
end if
Actually, you don't even need the "if" part; the switch structure itself 
will test for the contents of "what". So you could just do it this way:
on controlkeydown what
    switch what
     case "J"
       -- stuff
       break
      case "K"
        -- stuff
        break
      default -- this should probably be in there too
        pass controlkeydown
     end switch
end controlkeydown
-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com
    
    
More information about the metacard
mailing list