Topic: ASP Do...While Commands Looping is a common requirement in any scripting language, we will learn here how to use Do While, Until , Loops to manage execution of the code blocks more than once. Let us start with do While Loop , here the condition is checked for the starting of the loop and the code is executed only if the condition is TRUE . Here is the syntax Do While Condition Script block here Loop As long as the condition is satisfied ( or True ) the script block will be executed. Always at the starting the Condition is checked. Here is a simple script using Do While loop . Example Dim my_num my_num=1 Do While my_num <=10 Response.Write my_num & "<br>" my_num = my_num +1 Loop The above code will print 1 to 10 and it will fail to print 11 as the condition checking will return False.
|
|