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

Documentation Help for SHIFT Command

Discussion in 'Support' started by RogerB, Nov 11, 2014.

  1. RogerB

    Joined:
    Apr 18, 2014
    Messages:
    156
    Likes Received:
    3
    On the documentation page for SHIFT (TCC > Commands > Shift) I'm confused by the figures given. The first line says it allows the use of more than 512 parameters in a batch file. But just below that, under "usage" it says CMD can only handle 10 parameters and TCC supports 4096 parameters.

    I suspect some limits in TCC have been changed and the help hasn't been updated to match.
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    10,022
    Likes Received:
    84
    The help has been updated for build 52. (But you should never be using SHIFT anyway, unless you're writing for CMD -- and then you only have 10.)
     
  3. RogerB

    Joined:
    Apr 18, 2014
    Messages:
    156
    Likes Received:
    3
    Don't worry, I never have used it, and I'm not about to start! I just spotted the documentation problem when browsing around the batch file help topics.
     
  4. Jay Sage

    Joined:
    Jun 2, 2008
    Messages:
    284
    Likes Received:
    1
    Rex, why should one not use SHIFT, and what should one do instead? I have batch files that use it when I want to cycle through multiple command-line arguments with DO WHILE ... process %1 ... SHIFT ENDDO.
     
  5. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    10,022
    Likes Received:
    84
    Seems kinda klunky (and slow) -- why not just loop on %n (incrementing n each time) and exit the loop when "%n" == ""?
     

Share This Page