[If Statement] Comparing value to multiple integers
#1

Hi all,

I want to compare a variable against a lot of different integers. I tried the following, expecting it to fail and it did. However, it should give you an idea of what I'm trying to do:

Код:
if(myVariable != 1 && 2 && 8 && 12 && 13 && 14 && 15){
How do I actually do this, with out having 'myVariable' in the if statement a million times over?

Thanks
Reply


Messages In This Thread
[If Statement] Comparing value to multiple integers - by Jonesy96 - 08.07.2016, 18:14
Re: [If Statement] Comparing value to multiple integers - by SickAttack - 08.07.2016, 18:17
Re: [If Statement] Comparing value to multiple integers - by AbyssMorgan - 08.07.2016, 18:21
Re: [If Statement] Comparing value to multiple integers - by Ritzy2K - 08.07.2016, 18:26
Re: [If Statement] Comparing value to multiple integers - by Jonesy96 - 08.07.2016, 18:49

Forum Jump:


Users browsing this thread: 1 Guest(s)