On Tuesday, Oct 12 1999, Sven Schulzke wrote:

> Hi,
>
> I�d like an editable text field with certain behavior:
>
> 1. I want the user to be able to delete characters but not to reduce the
> number of lines when deleting text within the field.
>
> How would you script that? I tried to use the >on backspaceKey< message
> in the field script to trap messages but don�t know how the program
> should distinguish deleted characters from deleted lines.

on backSpaceKey
  put word 4 of the selectedChunk into tCharNo
  if charToNum(char tCharNo of me) is not 10 then pass backSpaceKey
end backSpaceKey

> 2. Similarly the user should not be allowed to add lines to the field -
> pressing the return key should take the cursor one line down in the
> field.
>
> I tried the >on returnKey< message in the field script but the syntax
> seems to be wrong:
>
>             on returnKey
>                 send arrowKey down to me
>             end returnKey

on returnInField
  put word 2 of the selectedLine into tLineNo
  add 1 to tLineNo
  select before line tLineNo of me
end returnInField

Regards,

Kevin

> Thanks for any help
>
> ---------
> Sven

Kevin Miller <[EMAIL PROTECTED]> <http://www.xworlds.com/>
Cross Worlds Computing, MetaCard Distributors, Custom Development.
Tel: +44 (0)131 672 2909.  Fax: +44 (0)1639 830 707.

Reply via email to