From: gazelle@shell.xmission.com   
      
   In article ,   
   Herbert Kleebauer wrote:   
   ...   
   >> P.S. The original question was: Is there a variable that expands to the #   
   >> of parameters passed. The answer to that is now known to be: NO.   
   >   
   >But you can calculate it:   
   >   
   >   
   >@echo off   
   >set nargs=0&call :nargs %*   
   >echo batch called with %nargs% parameters: %*   
   >goto :eof   
   >   
   >:nargs   
   >if [%1]==[] (goto :eof) else (shift & set /a nargs+=1 & goto :nargs)   
   >   
      
   This is nice; thanks. I actually ended up going with a version of this.   
      
   BTW, particularly cute is the lack of a space between the 0 and the &.   
   I assumed that I could put a space there (for "readability"), but then   
   found out why it is the way it is...   
      
   I did put a space after the &, though.   
      
   --   
   The randomly chosen signature file that would have appeared here is more than 4   
   lines long. As such, it violates one or more Usenet RFCs. In order to remain   
   in compliance with said RFCs, the actual sig can be found at the following URL:   
    http://user.xmission.com/~gazelle/Sigs/EternalFlame   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|