John,
Appending the literal type character I to a literal forces it to the
Integer
data type.
If you don't give a type on a numeric literal it defaults to Integer, you
can use a type character to ensure that it is specifically that type.
For example try the following, watching "value" in the Auto Watch window:
Dim value As Object
' Integer (32-bit integer) literals
value = 1
value = 2I
value = 3%
' Short (16-bit integer) literals
value = 1S
' Long (64-bit integer) literals
value = 1L
value = 2&
' Decimal literals
value = 1D
value = 2@
' Single literals
value = 1.0F
value = 2.0!
' Double literals
value = 1.0R
value = 2.0#
I normally favor the alpha character (I, S, L, F, R, D) over the special
character (%, &, !, #, @). The special characters are a hold over from
original Basic (pre Visual Basic).
The one I find missing is Byte literals.
Appending the identifier type character % to any identifier
forces it to Integer.
Allows both of the follow to work with Option Strict On. I never use the
type characters on identifiers (the second line).
Dim x As Integer
Dim y%
As you can see you can use either I or % as a suffix on a numeric literal,
however you cannot use the I suffix on an identifier, as there is no way to
determine if the suffix is a type character or part of the identifier.
Hope this helps
Jay