P
Phill. W
I have two routines
Public Sub Log( ByVal e as eLogLevel, ByVal saMsg as String )
Public Sub Log( ByVal i as Integer, ByVal saMsg as String )
(eLogLevel is a Public Enum)
(We started off with the Integer method, then wanted to add the
Enum overload to clarify the values that should be fed in).
Provided I call /each/ of these overloads with the /correct/ type in
the first argument, I get the correct version being called. However,
if (as many of my lot do), I use
o.Log( 0, "message" )
the compiled (I.L.) code shows the [first] Enum overload being called
and /not/, as I would have expected, the Integer one. Any value other
than zero correctly uses the Integer overload, so why does zero pick
the wrong one?
(I'm using VB.Net, VS 2003, v7.1.3088)
TIA,
Phill W.
Public Sub Log( ByVal e as eLogLevel, ByVal saMsg as String )
Public Sub Log( ByVal i as Integer, ByVal saMsg as String )
(eLogLevel is a Public Enum)
(We started off with the Integer method, then wanted to add the
Enum overload to clarify the values that should be fed in).
Provided I call /each/ of these overloads with the /correct/ type in
the first argument, I get the correct version being called. However,
if (as many of my lot do), I use
o.Log( 0, "message" )
the compiled (I.L.) code shows the [first] Enum overload being called
and /not/, as I would have expected, the Integer one. Any value other
than zero correctly uses the Integer overload, so why does zero pick
the wrong one?
(I'm using VB.Net, VS 2003, v7.1.3088)
TIA,
Phill W.