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
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


To change expression to date value

Response.Write Cdate("01-11-2010") ' Ouput 1/11/2010

Be the first to post comment on this article :


Post your comments , suggestion , error , requirements etc here .

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