Primal Scream

August 10, 2004
Every have one of those days were it seems like the world is secretly trying to scramble your brains? I'm having one today.
For some reason this statement compiles just fine:
if(anyYearCheck.Checked = false && (1 > 2)){
Did you notice the problem? Yeah? Well I didn't.
For those like me who didn't catch it, here is the deal; "Checked = false" doesn't check the value of Checked, it sets the value of Checked. So rather than checking for false I was setting it to false. This caused some rather intricate four-letter-word sentences to be expunged by yours truly.
What I find odd is that I'm positive that statements like this have cause compiler errors in the past. So like I said, the world must be secretly out to get me.
UPDATED: My code sample was wrong. This error requires the && to be included in the if statement.