ok. Heres the thing. I need to make cases for keydowns. I am catching the keycodes and them pass them on to switches. the un-understandable part for me is this:
I have the same case for 'TAB' and 'DOWN' keys. Now, I was wondering if instead of repeating the same code twice, I could use the logical 'OR' operator in cases:
Now:
switch(keycode){
case DOWN:
if(edtIndex == editSize - 1){
fieldPos = edtList[0];
edtIndex = 0;
}
else if(edtIndex < editSize - 1)
fieldPos = edtList[++edtIndex];
break;
case TAB:
if(edtIndex == editSize - 1){
fieldPos = edtList[0];
edtIndex = 0;
}
else if(edtIndex < editSize - 1)
fieldPos = edtList[++edtIndex];
break;
}
is it possible to do this:
switch(keycode){
case DOWN || TAB:
if(edtIndex == editSize - 1){
fieldPos = edtList[0];
edtIndex = 0;
}
else if(edtIndex < editSize - 1)
fieldPos = edtList[++edtIndex];
break;
}