posts - 225, comments - 7, trackbacks - 2

Technical Thoughts of Jorriss

Issues, ideas and technology solutions - The technical blog of Richie Rump

The Power of Not

No matter how many years I've been coding I always learn something new.  A few days ago I need to take the opposite value of a boolean variable.  Normally I would use an Inline If statement (I've also heard it called Immediate If).  I don't know why I do this, probably because of my beginnings in Access 2.0.

Button.Enabled = IIF(bValue, False, True)

After looking at the code and realizing something wasn't right I thought about the problem.  How do I take the inverse of a boolean value?  Duh use Not!

So here is what I came up with:

Button.Enabled = Not bValue

Much better.  I wonder what I'm going to learn tomorrow?

Print | posted on Thursday, February 19, 2004 9:55 PM |

Feedback

No comments posted yet.

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 7 and 8 and type the answer here:

Powered by: