Lorne has published two great functions. THANKS; this is to my taste. (I don’t want to clutter the Scripts and Example section, that’s why I use the General Forum.)
The validation scripts are a great example of how to “put functions into a table”. To everybody: Don’t miss them!
The function InputTest.Validate() was an “A-ha” experience. The test “if(String.TrimRight(strText, "1234567890-.") ~= "")” checks valid numeric input with five code lines. I have my own function Value() with more than 50 code lines (checking the ASCII value).
The only limit with Lorne’s script: It wouldn’t work outside US/Canada/UK. In countries using comma as the decimal point, you have to use the string "1234567890-,", but the decimal sign can be found in HKCU\Control Panel\International Value Name sDecimal or sMonDecimalSep (what’s the difference?). (Now Corey once more will say “Comma, Comma, Comma .. Chameleon”)
But I have a feeling that AMS already knows that I have the comma as decimal point. The help doc has this info about the input mask:
Decimal placeholder. (Special literal.) This will be replaced by the character specified as the decimal placeholder in the user's international settings. To force a period on all systems, use \. instead.
How can I wring the secret from AMS without reading the Registry?
But there’s another challenge with the input validation: How (when) to trigger the validation function? Of course you could have a Button.On Click event, but if the page has 8 input boxes, I should like to perform the validation immediately when the user has finished the input in each of the objects. “e_Key == 13” is one solution, but what to do when then user goes to Input2 by moving the mouse?
So far I have used this method:
* Enter/TAB to confirm input and move to next input object
* After the last input, force button Save/Candel to be pressed (or Enter in an invisible input object)
To take notice of mouse movement:
* An invisible image as a background object covering the input area, Image.On Leave actions starts the validation
My wish list has the item “Input.On Leave Event”. Could my wish be fulfilled in a future release?


