DaniWeb IT Discussion Community

Code Snippets (http://www.daniweb.com/code/)
-   asp (http://www.daniweb.com/code/asp.html)
-   -   Next and Loop (http://www.daniweb.com/code/snippet247.html)

Drew asp syntax
Apr 9th, 2005
Learn how to loop anything you want sertain number of times. In this
example im gonna show you a simple next and loop that changes the font
size.

  1. <%
  2. ' Define the variables you are going to use
  3. Dim LoopCount
  4.  
  5. 'Start the for next loop
  6. For LoopCount = 1 to 5
  7.  
  8. 'If you wanted to count from 5 down to 1
  9. 'it would look like this...
  10. 'For LoopCount = 5 to 1 step -1
  11.  
  12. 'Use the LoopCount value how you desire
  13. 'In this case it's used to change the font size
  14. %>
  15.  
  16. <font size=<%=LoopCount%>>Text</font><br><br>
  17.  
  18. <%
  19. 'Repeat your loop
  20. Next
  21. %>