Fixed CASEALL doesn't work

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

samintz

Scott Mintz
May 20, 2008
1,204
11
Solon, OH, USA
#1
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
 
#2
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.