Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Fixed CASEALL doesn't work

samintz

Scott Mintz
May
1,590
27
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
 
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

Back
Top