ASP ClassicLesson 32Free preview
ASP Looping
This lesson is part of ASP · All levels
Summary
Classic ASP iterations use For for constant counting, For Each for collection, as well as Do While and Do Until for condition-based iterations. Loops are very useful for reading the entire row recordset, creating tables, or repeating a particular process. Exit controls with Exit For and Exit Do prevent unlimited repetitions of running. (.Next)
Key points
- For... run a set number of iterations. (.Next)
- For Each searches for collection elements without an index. (.Next)
- Do While running the block during the correct conditions; Do Until stops when the conditions are met.
- Exit For and Exit Do stop the repetition early.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.