COMPUTER LANGUAGES HTML,C,C++.JAVA,.NET AND MULTIMEDIA basics and programs click home button
ADVANCE VB SCRIPT ISNUMBERIC
IsNumeric
The IsNumeric Function is used to check whether or not
the expression has a number subtype. It returns a Boolean value.
IsObject returns True if the expression contains an number subtype
otherwise the expression returns False.
Syntax
IsNumeric(expression)
Example
<!DOCTYPE html>
<html>
<body>
<script language="vbscript" type="text/vbscript">
Dim var, chk
var = 20
chk = IsNumeric(var)
Document.write "Line 1 : " & chk & "<br />"
var = "3.1415935745"
chk = IsNumeric(var)
Document.write "Line 2 : " & chk & "<br />"
var = "20 Chapter 23.123 VBScript"
chk = IsNumeric(var)
Document.write "Line 3 : " & chk & "<br />"
</script>
</body>
</html>
Save the file with .html extension upon executing the script in IE ,
the following result is displayed on the screen.
Line 1 : True
Line 2 : True
Line 3 : False
No comments:
Post a Comment