Showing posts with label while. Show all posts
Showing posts with label while. Show all posts

Wednesday, 27 April 2011

VBScript & ASP: loops!

   


Everybody uses looping functions with VBScript, however do we know how many possible variant there are? How many statements? Ok, now close your eyes and count them. How many statements can you remember?

The looping statements are used to repeat a block of code for a predetermined number of times. There are 4 statements to do so:
1) For ... Next - the code is run a number of times;
2) For Each ... Next - the code is run for each item in a collection;
3) Do ... Loop - the code is run until a condition is met;
4) While ... Wend - the same as Do ... Loop.