Mega Code Archive

 
Categories / VB.Net / Data Types
 

Int Long conversion

Imports System Imports System.Data Imports System.Collections public class MainClass    Shared Sub Main()         Dim I As Integer, L As Long         I = 50         L = I         Console.WriteLine(L)         L = 50         I = CInt(L) ' Explicit cast needed here         Console.WriteLine(I)         L = &H100000000         Try             I = CType(L, Integer)         Catch E As Exception             Console.WriteLine(E.Message)         End Try         Console.WriteLine(I)    End Sub End Class