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,617 of 42,547   
   Jean-Pierre Coulon to All   
   SET command won't append items in a loop   
   21 Feb 18 11:53:13   
   
   From: coulon@cacas.pam.obs-nice.fr   
      
   I want to set a variable to "mycommand p1.jpg p2.jpg p3.jpg" with a variable   
   numbers of jpg's. I wrote this batch:   
      
   set myorder=mycommand   
   for /L %%a in (1, 1, %1) do (   
   set myorder=!myorder! p%%a.jpg   
   echo %%a   
   echo %myorder%   
   )   
      
   but when I type mybatch 3 the second ECHO command gives always "mycommand"   
   instead of mycommand p1.jpg, mycomand p1.jpg p2.jpg etc.   
      
   set/? claims the ! instead of the % cures this problem.   
   --   
   Jean-Pierre Coulon   
      
   --- 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