Hi John,
An Integer is a value type and will always be initialized to a default value of 0. So, even if you don't assign a value explicitly, the value is 0.
If 0 has no special meaning in your app, you can compare against that value. Often, -1 is used for this scenario as well.
Alternatively, you can assign Integer.MinValue or Integer.MaxValue to your int. If later in your app the Int still has that value, it hasn't been changed:
Code:
Dim i As Integer = Integer.MinValue
...
If i = Integer.MinValue Then
' Not changed
Else
' i has changed
End If
HtH,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to:
Microphone Friend by
Rage Against The Machine (Track 1 from the album:
Renegades)