Data Conversion in Visual Basic

If option strict is on, so you'll need explicit conversion (from string to integer, vice versa and so on)
I found this table in MSDN library and I think it will be helpful for you
CBool
Any valid Char or String or numeric expression.
CByte
0 through 255 (unsigned); fractional parts are rounded.
CChar
Any valid Char or String expression; only first character of a String is converted; value can be 0 through 65535 (unsigned).
CDate
Any valid representation of a date and time.
CDbl
-1.79769313486231570E+308 through -4.94065645841246544E-324 for negative values; 4.94065645841246544E-324 through 1.79769313486231570E+308 for positive values.
CDec
+/-79,228,162,514,264,337,593,543,950,335 for zero-scaled numbers, that is, numbers with no decimal places. For numbers with 28 decimal places, the range is +/-7.9228162514264337593543950335. The smallest possible non-zero number is 0.0000000000000000000000000001 (+/-1E-28).
CInt
-2,147,483,648 through 2,147,483,647; fractional parts are rounded.1
CLng
-9,223,372,036,854,775,808 through 9,223,372,036,854,775,807; fractional parts are rounded.
CObj
Any valid expression.
CSByte
-128 through 127; fractional parts are rounded.
CShort
-32,768 through 32,767; fractional parts are rounded.
CSng
-3.402823E+38 through -1.401298E-45 for negative values; 1.401298E-45 through 3.402823E+38 for positive values.
CStr
Returns for CStr depend on the expression argument.
CUInt
0 through 4,294,967,295 (unsigned); fractional parts are rounded.
CULng
0 through 18,446,744,073,709,551,615 (unsigned); fractional parts are rounded.
CUShort
0 through 65,535 (unsigned); fractional parts are rounded.

0 comments:

Post a Comment