Reports whether the value of a string is a number.
IsNumber ( string )
Argument |
Description |
---|---|
string |
A string whose value you want to test to determine whether it is a valid PowerScript number |
Boolean. Returns true if string is a valid PowerScript number and false if it is not. If string is null, IsNumber returns null.
Use IsNumber to check that text in an edit control can be converted to a number.
To convert a string to a specific numeric datatype, use the Double, Dec, Integer, Long, or Real function.
This statement returns true:
IsNumber("32.65")
This statement returns false:
IsNumber("A16")
If the SingleLineEdit sle_Age contains 32, these statements store 32 in li_YearsOld:
integer li_YearsOld
IF IsNumber(sle_Age.Text) THEN
li_YearsOld = Integer(sle_Age.Text)
END IF