What is the VB.NET select case statement logic with case OR-ing?

后端 未结 5 1057
一个人的身影
一个人的身影 2021-02-06 20:42

I\'m using an Or statement in my case expression.

Even though I have a value within this range, it didn\'t find a match. Why not?

Example Code:<

5条回答
  •  Happy的楠姐
    2021-02-06 21:08

    As Jared said, you need to use the comma operator to delimit case statements.

    The Or you were doing is a bitwise OR, resulting in it being "3". Amusingly, "2 AND 3" would probably have worked for your specific case.

提交回复
热议问题