Control Variable Range?

So I would like to know, how do I write a range on a control variable in an If statement with possible Else attached.


Lets say for example:  If: This Variable 8 - 47. Else 48 - 50


Where "This Variable" is the name of the control variable with the range between 8 and 47 in the If statement  with an Else with a range between 48 and 50


An example with the If statement and example with the If and else statement combo would be nice.


Also would I put this code a Conditional Branch, Tab 4 in the Script Input box?


In other words how would I write that in javascript.


Thanks again any help would be appreciated.
There are lots of ways to embed conditional branches to achieve this, but the cleanest solution would be to use the script option in the conditional branch and use the following:


$gameVariables.value(index) >= 8 && $gameVariables.value(index) <= 47


Then, in your else branch start another conditional branch and use this:


$gameVariables.value(index) >= 48 && $gameVariables.value(index) <= 50


Change "index" to the number of the variable you want to check.
Thank you thats great.... would you know what it would be if i wanted to get a number of potions for example... such as item.value(index) what would it be in other words to be able to do it with items if you can. Thanks again
I'm not 100% sure but I think this might work:


$gameParty.numItems($dataItems[index])


There may be a more concise way but I'm not super familiar with the code yet.
Ok do you know how display it in a text box... such as i know control variable can display with \V[10]  i.e show the quantity of control variable 10.. 
I don't know a way to directly inject it into a message. Just store it to a temp variable before the message window pops up, then display the temp variable. Make sure to post back if that code above works or not because someone else may come here with the same question.
Hey great! Thanks a bunch! It works by the way!

Original thread: https://forums.rpgmakerweb.com/threads/control-variable-range.60654/