Use CInt to convert long to Integer : Long « Data Types « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Date Time
8.Development
9.Event
10.File Directory
11.Generics
12.GUI
13.Internationalization I18N
14.Language Basics
15.LINQ
16.Network Remote
17.Reflection
18.Security
19.Thread
20.Windows Presentation Foundation
21.Windows System
22.XML
23.XML LINQ
VB.Net » Data Types » LongScreenshots 
Use CInt to convert long to Integer
 
Imports System.Globalization

Module Example
   Public Sub Main()
        Dim lNumber As Long = 9999999999
        Try
           Dim number1 As Integer = CInt(lNumber)
           Console.WriteLine(number1)
        Catch As OverflowException
           Console.WriteLine("{0} is out of range of an Int32.", lNumber)
        End Try
   End Sub
End Module

   
  
Related examples in the same category
1.Long and Single NumberLong and Single Number
2.Append long data type values to a StringBuilder object.
3.Get Long MinValue
4.Is Long value signed
5.Convert long value to string 16 based
6.Convert string value to UInt64
7.And two UInt64 values
8.Use the Sign(Long) method to determine the sign of a Long value and display it to the console.
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.