Variable assignment issues, how to interpret

Viewed 43

I'm having trouble understanding what's happening in this code:

Lock.Value = reader("Some_SQL_Value_Here") > approval

What's really confusing me is the greater than sign.

Does the Lock.Value get assigned the greater value?

does something else happen?

1 Answers

This part:

reader("Some_SQL_Value_Here") > approval

is a Boolean expression. It evaluates to either True or False. It is that Boolean value that is assigned to the property. It's akin to this:

Lock.Value = reader("Some_SQL_Value_Here") + approval

Would you be confused by an expression containing an operator evaluating to a value and that value being assigned in this case? I would think not. Your original code is basically the same, except a magnitude comparison evaluates to a Boolean where an addition evaluates to a number.

Related