Inheritance problem?

Mark Wieder mwieder at ahsoftware.net
Fri Jun 13 21:16:12 EDT 2008


Charles-

> I created an app with two fields for entry of text and and 22 number only
> fields. Despite NO code being in the two text fields followed by the 
> numeric
> fields, the two text fields have acquired the code of number boxes -
> allowing only two digits! I tried the following code to allow alphanumeric
> entry:


Hmmm. I get different results, so something else must be going on.

Your text entry validation code works fine and limits the keys to 
alphanumeric values.
But the numeric code doesn't do anything. Try this to limit to two digits:

on keyDown pWhichKey
  if the selection is not empty then
    delete the selection
  end if
  if pWhichKey is a number then
    if the length of me < 2 then
      pass keyDown pWhichKey
    end if
  end if
end keyDown

-- 
 Mark Wieder
 mwieder at ahsoftware.net 






More information about the use-livecode mailing list