You are here:

Visual Basic/Comparing Integers

Advertisement


Question
In Visual Basic Studio 2012, what is the coding to compare 2 integers (Greater than, less than, equal to)?

Answer
Dear Adam,

It is standard chars: <  >  <=  >=  =


Dim I1 As Integer = 9

Dim I2 As Integer = 45

Dim bIsGreater As Boolean = False

If I1 > I2 then
 bIsGreater = True
Else
 bIsGreater = False
End If

Something like this


Sincerely,

Vitaly  

Visual Basic

All Answers


Answers by Expert:


Ask Experts

Volunteer


VITALY

Expertise

Area of expertise is Visual Basic .NET (VS 2008 and Framework 3.5) design and development for Windows applications. You can ask me any Visual Basic questions and some questions about .NET Framework. You can also ask me how to use Component One controls in Visual Basic. Do not ask me questions about Web design and development in Visual Basic.

Experience

I'm working as VB programmer from 1997, so I have a lot of experience with Visual Basic .NET as well as Visual Basic 6. Area of expertise is Visual Basic .NET (VS 2008 and Framework 3.5) design and development for Windows applications; Component One controls for Visual Basic; User controls; Moving VB6 applications to .NET.

Education/Credentials
B.S. in Computer Science

©2016 About.com. All rights reserved.