Fixed CASEALL doesn't work

samintz

Scott Mintz
May 20, 2008
1,555
26
Solon, OH, USA
When I tested the do loop code for the posting about SHIFT, I encountered an error with the SWITCH statement.

In this simple batch script, the CASEALL is never executed. (Tcc 13.04.61)
Code:
do until %1.=. 
    switch %1
    case A .OR. B
      echo %1
    caseall
      shift
    default
       echo usage: blah blah blah...
       quit
    endswitch
enddo
 
May 20, 2008
12,167
133
Syracuse, NY, USA
Confirmed. But it does work if it's *after* the DEFAULT case.

In any event it doesn't seem a good idea to rely on CASEALL to SHIFT the args since you don't get CASEALL if no (non-default) case is matched.
 

Similar threads