CType
- wandelt einen Typ in einen angegebenen anderen Typ um
' wandelt die Zahl 123.45 in einen String um Dim n As Decimal = 123.45 Dim s As String s = CType(n, String)
spezielle Typumwandlungen, welche immer einen übergebenes Objekt in den festgelegten Typ wandeln
- CBool – Bool
Dim bBoolean As Boolean bBoolean = CBool(0) ' False bBoolean = CBool(1) ' True
Dim i1 As Integer = 56 Dim d As Double = CDbl(i1) / 3.14
Dim i1 As Integer = 5000 Dim d As Decimal = CDec(i1) / 34)
Dim i1 As Integer = 1005 Dim i2 As Integer = 2100 Dim l As Long = CLng(i1) * CLng(i2)
Dim i1 As Integer = 56 Dim z As Single = CSng(i1) / 3.4