Jump to content

loop statements ? batch files


Recommended Posts

can anyone explain to be in cave man terms what are loop statements do saw it in a book and ive been tryin thr past couple of days to figure out what does it do and whats its syntax means

Link to comment
Share on other sites

  • Replies 1
  • Views 945
  • Created
  • Last Reply
FOR %A IN (list) DO command [ parameters ]

The above basic loop syntax provides the means of iteration. iteration stand for "Do this for a specified amount of times".

command along with its parameters declares "what to do".

list is an array of elements

%A is substituded with an array element

so basically all it says is : For every element in the array (which is substituded by %A) DO what command says

FOR %A IN (1 2 3) DO ECHO Now using %A from list


Now using 1 from list

Now using 2 from list

Now using 3 from list

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...