Code: Select all
for i=0 to 2
mc_isrtxrx.write("i: "+dectostr(i)+" ")
select i
case 0
mc_isrtxrx.write("Case 0"+cr+lf)
case 1
mc_isrtxrx.write("Case 1"+cr+lf)
case 0, 1
mc_isrtxrx.write("Case 0,1"+cr+lf)
case 2
mc_isrtxrx.write("Case 2"+cr+lf)
case 0,1,2
mc_isrtxrx.write("Case 0,1,2"+cr+lf)
end select
next
which uses my interrupt driven "Write" routine.
The result is:
i: 0 Case 0
i: 1 Case 1
i: 2 Case 2
I guess I should have expected this "short circuiting" behavior, most languages do this. I just did not read carefully enough the line in the help file:
"If one of the case conditions is met, then any statements following the condition are executed and the program jumps to any code immediately following endselect"
So in this case I will have to use a series of (non-nested) IF/THEN statements. Just not quite as elegant-looking!
Maybe this will help someone else not waste any time !