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

Fixed CASEALL doesn't work

Discussion in 'Support' started by samintz, May 1, 2012.

  1. samintz

    samintz Scott Mintz

    Joined:
    May 20, 2008
    Messages:
    1,177
    Likes Received:
    11
    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. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,784
    Likes Received:
    29
    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.
     

Share This Page