One thing about this is that you might want to include some code to trim any
leading zeros. If the application asks for, say a PIN code, and the user
inputs 0234, this function will return false because TCL will not add 1 to
0234, but it will add it to 234.

Also, if you're looking for strict INTEGER validation (not just numeric
validation), you'll want to check for any decimals and return false without
testing the expression.

In a message dated 8/9/2001 6:14:36 PM Eastern Daylight Time, [EMAIL PROTECTED]
writes:

> if {[catch {set res [expr $someVar + 1]}]} {
>        #someVar is not a number
> } else {
>         # it is a number
> }
>

Reply via email to