Hello,
I have a slider where I check the current value to see if it’s within various number ranges. I’m basically running the same comparison over and over for 14 range sets. Is there a way to not have to hard code each one?
The snippet below is hard coded 14 times with incrementing boxes[x] values. boxes[x] is a predefined array:
if (sliderval >= boxes[1].position && sliderval < boxes[2].position) {
//do 1st code
}
else if (sliderval >= boxes[2].position && sliderval < boxes[3].position) {
//do 2nd code
}
//etc...
These ranges are checked as the user moves the slider button.
Any suggestions would be great!
Thanks,
Jason