Apr 6, 2018 at 10:52am UTC
I am wanting to create a table of iRval and rs values so if a key corresponding to iRval is pressed the an answer of rs is given instead of all these if statements.
I used to use similar think with a table and vLookup in Excel.
if(iRval == 1 || iRval == 2049) rs=1;
else if(iRval == 2 || iRval == 2050) rs=2;
else if(iRval == 3 || iRval == 2051) rs=3;
else if(iRval == 4 || iRval == 2052) rs=4;
else if(iRval == 5 || iRval == 2053) rs=5;
else if(iRval == 6 || iRval == 2054) rs=6;
else if(iRval == 7 || iRval == 2055) rs=7;
else if(iRval == 8 || iRval == 2056) rs=8;
else if(iRval == 9 || iRval == 2057) rs=9;
else if(iRval == 0 || iRval == 2048) rs=0;
else if(iRval == 56 || iRval == 2104) rs=11;
else if(iRval == 35 || iRval == 2083) rs=12;
else if(iRval == 16 || iRval == 2064) rs=13;
else if(iRval == 32 || iRval == 2080) rs=14;
else if(iRval == 17 || iRval == 2065) rs=15;
else if(iRval == 33 || iRval == 2081) rs=16;
else if(iRval == 35 || iRval == 2083) rs=17;
else if(iRval == 13 || iRval == 2061) rs=18;
else if(iRval == 60 || iRval == 3108) rs=19;
else if(iRval == 20 || iRval == 2068) rs=20;
else if(iRval == 21 || iRval == 2069) rs=21;
else if(iRval == 36 || iRval == 2084) rs=22;
else if(iRval == 15 || iRval == 2063) rs=23;
else if(iRval == 38 || iRval == 2086) rs=24;
else if(iRval == 45 || iRval == 2093) rs=25;
else if(iRval == 43 || iRval == 2091) rs=26;
else if(iRval == 41 || iRval == 2089) rs=27;
else if(iRval == 44 || iRval == 2092) rs=28;
else if(iRval == 12910 || iRval == 12439) rs=29;
else if(iRval == 18022 || iRval == 22261) rs=30;
else if(iRval == 25433 || iRval == 25190) rs=31;
else if(iRval == 25595 || iRval == 25838) rs=32;
else if(iRval == 24153 || iRval == 10372) rs=33;
else if(iRval == 8365 || iRval == 16922) rs=34;
else if(iRval == 7962 || iRval == 17325) rs=35;
else if(iRval == 19306 || iRval == 15223) rs=36;
else rs=99;