A Problem with Return in a Field

William de Smet wdesmet at wanadoo.nl
Fri Dec 15 06:33:17 EST 2006

Hi Charles,

I don't know if it solves your problem but I use:
on returnInField
   put line 1 of me into me
   answer error "Only one word allowed!" with "OK"
end returnInField

on closeField
   if return is in me then
   end if
   pass closefield
end closefield

on keyDown pKey
  if charToNum(pKey) <> 32 then pass keydown
  answer error "Only one word allowed!" with "OK"
end keyDown

In this I force the user to use just one word!


WIlliam de Smet

2006/12/15, Charles Szasz <cszasz at mac.com>:
> Despite the suggestions made to correct this problem, the problem
> still exists. I tried the suggestion of changing the field of the
> field so that only one line could fit.  i changed the fields to a
> field height of 18 and a text height of 14 with and without Don't
> Wrap option turn on and off. But that only works on a sporadic basis.
> The numbers will disappear to the left and pressing the Return does
> nothing to restate the numbers or advance to the next field. You have
> to use the Delete to make the two digit number appear but pressing
> the Return again makes the number disappear again. This occurred in
> one of five edit fields with all having the same dimensions and
> options in the Inspector.
> This is the script:
> on keyDown whichKey
>    if whichKey is a number then
>      if the selection is not empty then delete the selection
>      if the length of me < 2 then
>        pass keyDown
>      else
>        beep
>      end if
>    end if
> end keyDown
> I also tried another suggestion that forces a Return to tab but that
> disable the script for allowing only two digits numbers in the
> script. So, it really lo
> Charles Szasz
> cszasz at mac.com
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

Herman Broerenschool
2612 SP Delft

More information about the Use-livecode mailing list