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,378 of 68,980   
   Herbert Kleebauer to Tom Del Rosso   
   Re: Copy all files into a format I can u   
   26 Mar 19 20:15:30   
   
   From: klee@unibwm.de   
      
   On 26.03.2019 02:30, Tom Del Rosso wrote:   
      
      
   > For clarity, and for the record, lets parse that out.   
   >   
   > The first CALL sees (for the letter b for example):   
   > call set text=%%%%text:b=%%u[b]%%%%%%   
   >   
   > Then I'm not completely sure what the next CALL sees.   
      
   for %%i in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do set   
   u[%%i]=%%i   
      
   This "for" loop sets a pseudo array:   
      
   u[A]=A   
   u[B]=B   
   u[C]=C   
   :   
   :   
      
   for %%i in (a b c d e f g h i j k l m n o p q r s t u v w x v z) do call call   
   set text=%%%%text:%%i=%%u[%%i]%%%%%%   
      
   Each "call" evaluates the remaining line (%% is replaced by % and   
   variables are replaced by their value).   
      
   After the first call we get (for the letter b):   
      
   call set text=%%text:b=%u[b]%%%   
      
   After the second call:   
      
   set text=%text:b=B%   
      
   and if this is executed, every "b" is replaced by a "B"   
   in the variable "text".   
      
   --- 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