TypeName() returns a readable type name, while VarType() returns a numeric subtype code.
Dim v1 'Declaring variable v1
v1="Welcome" 'assigning value
Response.Write "Value of v1=" & v1
Response.Write "<br> v1 is a <i>" & TypeName(v1) & "</i> variable "
In the above code we have declared v1 as a variable and assigned a string data to it. So now the variable v1 became string variable. So we will get an output like this by using the above code.
Value of v1=Welcome
v1 is a String variable
We can change the value of v1 to different values and see the type of variable TypeName function returns.
Dim v1 'Declaring variable v1
v1="Welcome" 'assigning value
Response.Write "Value of v1=" & v1
Response.Write "<br>is v1 an array? <i>" & isArray(v1) & "</i> "
The output of the above code is shown here.
Value of v1=Welcome
is v1 an array? False
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.