Conversion functions allow you to change the subtype of a variable. VBScript assigns the variant type to all variables as a default, but there are many cases when you might have to convert a variable to a particular type to satisfy an arguement. A common example would be that you might have a string arguement that returns a numeric value or a numeric arguement that returns a string value. Here are some of the most commonly used conversion functions:
CByte
CByte(strExample)
The CByte function converts this variable to a subtype byte.
CDbl
CDbl(strExample)
The CDbl function converts this variable to a subtype double.
CInt
CInt(strExample)
The CInt function converts this variable to a subtype integer.
CLng
CLng(strExample)
The CLng function converts this variable to a subtype long.
CStr
CStr(strExample)
The CStr function converts this variable to a subtype string.
http://www.aspwebpro.com/aspscripts/functions/conversion.asp
No comments:
Post a Comment