Here is a snippet of vbscript I use in ASP and/or VBS applications where I need a select case statement for a range of values for each case. There isn’t too much documentation online about this, and it’s a bit of a hack, but this will do the trick.
1 2 3 4 5 6 7 8
select case TRUE case your_var >= 0 and your_var < = 4 'do your stuff case your_var >= 5 and your_var < = 10 'do your stuff case else 'handle the else end select
Basically, it tells the vbscript engine to select the case that evaluates to TRUE (or you could set to false, or any other value, such as “select case 199″ where it would choose the case whose statement evaluated to 199, depending on your requirements)
I know this is a bit of a hack but hey, classic asp is not as robust as some other languages, and so we have to inprovise. one other note, my example has values hardcoded into the select case statements. This is poor programming practice, and was only used for simplicity’s sake in demonstrating how the vbscript select case for a range of values statement works.