Pelles C forum
C language => Windows questions => Topic started by: gromit on May 05, 2012, 09:42:56 PM
-
Hi folks
Is there a better way
case IDM_SUBJUMP:
case IDM_SUBJUMP+1:
case IDM_SUBJUMP+2:
case IDM_SUBJUMP+3:
case IDM_SUBJUMP+4:
case IDM_SUBJUMP+5:
case IDM_SUBJUMP+6:
case IDM_SUBJUMP+7:
case IDM_SUBJUMP+8:
case IDM_SUBJUMP+9:
case IDM_SUBJUMP+10:
I need another 10 yet
wondered if there was a way to do it with some sort of range etc
Big Thanks In Advance Gromit :) :) :)
-
From help:
A range of values can be specified as an extension: case constant-expression ... constant-expression - see the /Zx option. [4.00]
-
Alternatively.... if compatibility is an issue use an if() else if() cascade in place of your switch statement.
if ((x < subjump+20) && (x >= subjump))
{ do_whatever() }
else if (...
-
Thanks for your answers folks
Although i have now revised my programming
That switch was a large popup sub menu that has become too large and i am now implementing it as a combobox
However i would be interested to know how to implement the zx option
is
it some sort of #define or #include ???
Be great to try to understand that
Big Thanks Gromit
-
However i would be interested to know how to implement the zx option
You find this at Help => Contents => C Language Reference => Statements => switch statement ;)
-
However i would be interested to know how to implement the zx option
Project -> Project options -> Compiler -> Enable Pelles C Extensions = checked.