home bbs files messages ]

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

   alt.msdos.batch      Fun with MS-DOS batch files      42,547 messages   

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

   Message 41,737 of 42,547   
   Herbert Kleebauer to Anton Shepelev   
   Re: Turing-competeness of the batch lang   
   27 Aug 19 19:47:52   
   
   From: klee@unibwm.de   
      
   On 26.08.2019 22:48, Anton Shepelev wrote:   
   > Herbert Kleebauer:   
   >   
   >> echo a>a.txt   
   >> echo b>b.txt   
   >> echo c>c.txt   
   >> set list=   
   >> for  %%i in (*.txt) do call set list=%%list%%,%%i   
   >> echo %list%   
   >   
   > Thank you.  What does the double percent in %%list%%   
   > do?  I didn't find an explanation in  the  help  for   
   > either SET or FOR.   
      
   When the line is parsed, %% is replaced by %, so it becomes:   
      
   call set list=%list%,%%i   
      
   when the call is executed, %list% is replaced by the current value.   
      
   For example, if you want to convert a text to upper case,   
   you can use:   
      
   @echo off   
   set text=Hello World 123   
   echo %text%   
      
   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   
   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]%%%%%%   
      
   echo %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