From: gazelle@shell.xmission.com   
      
   In article , Dallas wrote:   
   >On 6/30/2022 7:11 AM, Kenny McCormack wrote:   
   >> In article , Dallas wrote:   
   >>> I had no idea you could have internal subroutines like that.   
   >>> You can even use recursion.   
   >>> Thanks for the example!   
   >>   
   >> Note that, in the olden days (COMMAND.COM), you had to do this yourself -   
   >> brute force. I often coded it like:   
   >>   
   >> if %1X==L10X goto L10   
   >> echo main routine - Now calling L10 routine...   
   >> %0 L10   
   >> goto the_end   
   >> :L10   
   >> echo here we are in L10 subroutinue...   
   >> :the_end   
   >>   
   >> I assume that the powers that be at MS noticed that people were doing this   
   >> sort of thing, so they codified it into the language (in CMD.EXE versions   
   >> of the batch language).   
   >>   
   >   
   >That is how I have been doing it too.   
   >But now I will use the CALL variation as it self-documents so much better.   
      
   Actually, there is a typo in my previous post.   
      
   >> %0 L10   
      
   should, of course, be:   
      
    call %0 L10   
      
   (since batch files don't, by default, return; hence the invention of "call")   
      
   --   
   "The party of Lincoln has become the party of John Wilkes Booth."   
      
    - Carlos Alazraqui -   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|