Constraining user input...

Sarah Reichelt sarahr at genesearch.com.au
Wed Feb 27 19:57:01 EST 2002


I don't know that this is a very elegant solution, but it works so it can
get you started. Put this in the script of your text entry field.

on keyDown theKey
  if the number of lines in me >= 3 and \
      the number of chars in line 3 of me >= 30 then
    beep
    exit keyDown
  else
    put word 2 of the selectedLine of me into theLine
    if the number of chars in line theLine of me >= 30 then
      beep
      exit keyDown
    end if
  else
    pass keyDown
  end if
end keyDown

Cheers,
Sarah


> Hello, 
> 
> I am completely new to Revolution, but am very interested in using it for
> on-going projects....  My single biggest need though is to be able to
> constrain the user input to a set number of characters and lines... For
> example, for a textbox entry they should only be able to enter 30 characters
> of text per line and only 3 lines.....
> 
> Is this possible with Revolution?.. If you could provide an example I sure
> would appreciate it.....
> 
> Thanks! 
> 
> Greg Saylor 
> Senior Systems Integrator





More information about the use-livecode mailing list