Heya, for the life of me I cannot remember (and I'm apparently failing on finding examples)...
I want to run a switch statement with numerical ranges. Example: I want it to do function x for range 1-10, function y for range 11-20, and default function z.
What is the syntax for case?
All I could remember was
etc. But that doesn't work.
Help?
And thanks in advance...
I want to run a switch statement with numerical ranges. Example: I want it to do function x for range 1-10, function y for range 11-20, and default function z.
What is the syntax for case?
All I could remember was
Code:
case 1..10: func_x();
break;
case 11..20: func_y();
break;
default: func_z();
break;
Help?
And thanks in advance...