BUILT IN FUNCTIONS TO KNOW THE SUB TYPE OF THE VARIABLE

 1.varType()-returns the numeric representation of the variable.
 2. typeName()-returns the text representation of the sub type of the variable



Example:

<html>
<head>
</head>
<body >
<script type="text/vbscript">
Dim c
c = 4
document.write("c value is = " & c & "<br />")
document.write("The numeric representation of c is " & VarType(c)  & "<br />")
document.write("The variable c is of " & TypeName(c) & " data type."  & "<br />")
</script>
</body>
</html>

output:
c value is =4
The numeric representation of c  is 2
The variable c is of Integer data type.

No comments:

Post a Comment