home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch.nt      Fun with Windows NT batch files      68,980 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 67,631 of 68,980   
   Kenny McCormack to klee@unibwm.de   
   Re: Two simple, but related questions ab   
   04 Oct 20 12:15:58   
   
   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)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca