How to test for a number

Lynch, Jonathan BNZ2 at CDC.GOV
Wed Mar 16 10:30:53 EST 2005


If isNumber(tAdd) = false then...

-----Original Message-----
From: use-revolution-bounces at lists.runrev.com
[mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of Kevin J
Sent: Wednesday, March 16, 2005 10:28 AM
To: rev
Subject: How to test for a number

How do you make an If check to check to see if a user has entered a
number and not a letter?
I can stop it from doing a divide by 0 doing this:

on mouseUp
put field"num1" into tAdd
put field"num2" into tAdd2
  if tAdd2 is 0 then
    answer "You can't divide by 0"
  else
    put tAdd/tAdd2 into field"sum"
    end if
end mouseUp

Thanks

Kevin
_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list