Question : how to use the swich statement or if else

i got the data from the device like
x=0200
0400
0800
1000
0600
0A00
1200
0C00
1400
1800
0E00
1600
1C00
1A00
1E00

any one value i got at a time from device

i convert 0200->0010
0400->0100 like this...


but i am not able to do, i got the error Integer Number Too large(0800) and : expected in 1C00, 1A00, 1E00
Anybody having idea pls help me
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
switch (x) {
                           case 0200:
                            //doSomething0();
                              //   0010
                            break;
                          case 0400:
                             //   0100
                           // doSomething1();
                            break;
                          case 0800:
                           // doSomething2();
                            break;
                          case 0600:
                           // doSomething3();
                            break;
                          case 0A00:
                           // doSomething4();
                            break;
                             case 1200:
                           // doSomething4();
                            break;
                             case 0C00:
                           // doSomething4();
                            break;
                             case 1400:
                           // doSomething4();
                            break;
                              case 1800:
                           // doSomething4();
                            break;
                              case 0E00:
                           // doSomething4();
                            break;
                              case 1600:
                           // doSomething4();
                            break;
                               case 1C00:
                           // doSomething4();
                            break;
                               case 1A00:
                           // doSomething4();
                            break;
                               case 1E00:
                           // doSomething4();
                            break;
                          default:
                            //doSomethingElse();
                        }

Answer : how to use the swich statement or if else

see the link I posted above. it shows how to parse a hex string
Random Solutions  
 
programming4us programming4us