Limiting the number of characters per line in a scrolling field?

Glen Bojsza gbojsza at gmail.com
Sat Apr 23 06:50:41 EDT 2005


I would like to limit the number of characters a user can input on any
line in a scrolling field.

In the field script

on keydown theKey
  if theKey is not in " 0 1 2 3 4 5 6 7 8 9 - . " then 
  beep
  exit keydown
    else
    if (the length of me) > 4 then 
    beep
    exit keydown
    end if
    pass keydown
  end if
end keydown

  "if the length of me is > 4 then..."  this works but limits the
TOTAL field to 4 characters.

thanks


More information about the use-livecode mailing list