|
|
|
|
Use:
|
To Convert:
|
To :
|
Comments
|
|
CBool(expression)
|
Any Variant argument
|
An equivalent Boolean data type
|
expression can be a string or numeric
|
|
CByte(expression)
|
Any Variant argument
|
An equivalent Byte data type
|
|
|
CCur(expression)
|
Any Variant argument
|
An equivalent Currency data type
|
|
|
CDate(expression)
|
Any Variant argument
|
An equivalent Date data type
|
|
|
CDbl(expression)
|
Any Variant argument
|
An equivalent Double data type
|
|
|
CDec(expression)
|
Any Variant argument
|
A Decimal
|
|
|
CInt(expression)
|
Any Variant argument
|
Rounds the fractional part of the argument to the next highest Integer
|
|
|
CLng(expression)
|
Any Variant argument
|
An equivalent Long data type
|
|
|
CSng(expression)
|
Any Variant argument
|
An equivalent Single data type
|
|
|
CStr(expression)
|
Any Variant argument
|
Depends on the data type of theexpressionargument: For Booleans,CStr returns True or False. For Dates,it returns a date based on the short date format on your system. For Errors, it returns the word "Error" followed by the error number.Numeric expression values return a string containing the number.
|
The string that CStr returns if expression is Empty is a zero-length string. If the expression has a Null value, a runtime error will result.
|
|
CVar(expression)
|
Any Variant argument
|
An equivalent Variant data type
|
expression can be a string or numeric
|
|
Hex(expression)
|
A Numeric argument
|
A Hexadecimal (Base 16) number equivalent
|
|
|
Int(expression)
|
A Numeric argument
|
A number rounded down to the integer less than or equal to its argument
|
|
|
Str(expression)
|
A Numeric argument
|
A Variant that can be used as a string.
|
Adds a leading blank before positive numbers that Cstr() does not
|
|
Oct(expression)
|
A Numeric argument
|
An Octal(Base 8) number equivalent
|
|
|
Val(string)
|
A String argument
|
Numeric
|
If the string does not contain numeric data, then the Val function returns a zero
|
|
Go Back to Top
Return to the Visual Basic 6 Commands & Functions Page
|