Question

if (%var == 1 or 2 or 3 or 4 or 5) { }

So what u want is to check whether the variable's value is in between 1-5 in mirc?

I can do it like this:

if (%var == 1) {  }
if (%var == 2) {  }
if (%var == 3) {  }
if (%var == 4) {  }
if (%var == 5) {  }

But is there any shorter way?

Was it helpful?

Solution

The idiomatic answer is:

if (%var isnum 1-5) {

}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top