Typecasting Variables
We can check the variable type by using TypeName. To change from one type to other we can use different functions.
Expression to Integer by Cint
Dim v1
v1=5.43
Response.Write "Type of " & typename(v1)
Response.Write "<br>"
Response.Write Cint(v1) ' Output will be 5
If the last line is changed by using Cdbl then output will be like this
Response.Write Cdbl(v1) ' Output will be 5.43
CDate
To change expression to date value
Response.Write Cdate("01-11-2010") ' Ouput 1/11/2010
This article is written by plus2net.com team.
Be the first to post comment on this article :
plus2net.com
|