Last post Feb 04, 2010 02:20 PM by WombatEd
Jun 03, 2009 10:59 AM|WombatEd|LINK
(I'm sure this has to be something really dumb, but my brain went out for a walk yesterday and didn't come back.)
I have a class that defines a string constant named
NullChapterId as "". But during execution, references to it return "nothing".
Here's the code:
Jun 03, 2009 11:43 AM|WombatEd|LINK
I've managed to work around this problem by replacing the Const with a Public Shared ReadOnly Property using the same name.
I've also verified that a similar Integer constant works as expected; this issue apparently applies only to string constants.
Jun 23, 2009 04:42 PM|WombatEd|LINK
It turns out that Visual Web Developer 2008 (express) wasn't properly recognizing that a string constant was being passed to a Sub where an
integer parameter was required. The "OPTION STRICT ON" failed to recognize that my constant didn't match. Once I replaced the Const with a Public Shared ReadOnly Property using the same name, the error surfaced.
After fixing the type mismatch, I could then go back to using a Const instead of a property.
Feb 04, 2010 02:20 PM|WombatEd|LINK
FWIW, I've re-created this problem using Visual Studio 2008 Profesional Edition.
And I've noticed that it doesn't do this to strings containing text; only the empty "" string fails.