limits for variable and program space are given at the
innovations first webiste. As for putting ranges in the switch-case loop, to the extent of my knoledge, it cannot be done like in PBasic; you need to use some if statements. If it is just for one range and everything else is a single value, put it as a comparison in the
default: tag, or as just the default tag if the situation permits. The other meathod is to create a char variable just for your switch-case loop and do some comparisons first, so it would look something like this:
Code:
char case_range
if(x<60)
{
case_range=0;
}
else if(x<127)
{
case_range=1;
}
else
case_range=2;
switch(case_range)
{
case 1:
statements
case 2:
statements
case 3:
statements
}
And do that for however many cases you need. If you only need 2, you can even go with the whole ? : operator--
case_range=(127<=x && 225>=x) ? 1 : 0.
On that note, does anybody know if you can nest the ?: operator? i.e.
x=(condtion 1) ? 1 : (condition 2) ? 2 : (condition 3) ? 3 : ... (condition n) ? n : 0