开发者

What condition can I use to check if a button tab is in a range?

I need to check if a button tab is between 91 and 96 inclusive.

I don't want to write:

if (button.tab==91) {
    ...
}
if (button.tab==92) {
开发者_Python百科    ...
}
...

Instead, I want to use a single condition.

How can I do this?


if (button.tab >= 91 && button.tab <= 96)
{
    // do stuff!
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜