Data Type Conversion Functions


The following table lists the Visual Basic data type conversion functions.

Open table as spreadsheet

Function

Converts To

CBool

Boolean

CByte

Byte

CChar

Char

CDate

Date

CDbl

Double

CDec

Decimal

CInt

Integer

CLng

Long

CObj

Object

CSByte

SByte

CShort

Short

CSng

Single

CStr

String

CUInt

UInteger

CULng

ULong

CUShort

UShort

Remember that data types have their own parsing methods in addition to these data type conversion functions. For example, the following code converts the String variable a_string into an Integer value:

  an_integer = Integer.Parse(a_string) 

These methods are faster than the corresponding data type conversion function (in this case, CInt).




Visual Basic 2005 with  .NET 3.0 Programmer's Reference
Visual Basic 2005 with .NET 3.0 Programmer's Reference
ISBN: 470137053
EAN: N/A
Year: 2007
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net