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

ASP Home

plus2net.com





We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
©2000-2025   plus2net.com   All rights reserved worldwide Privacy Policy Disclaimer