ASP/VBScript Do ... Loop ทำงานในลูปก่อนพิจารณาเงื่อนไข
Syntax
<%
Do [{While | Until} condition]
statements
Loop
Do
statements
Loop [{While | Until} condition]
%>
Sample
<%
Option Explicit
Dim i
i = 1
Do While i <= 5
Response.write("www.ThaiCreate.Com<br>")
i = i + 1
Loop
Response.write("<hr>")
i = 1
Do
Response.write("www.ThaiCreate.Com<br>")
i = i + 1
Loop While i <= 5
Response.write("<hr>")
i = 1
Do Until i = 5
Response.write("www.ThaiCreate.Com<br>")
i = i + 1
Loop
Response.write("<hr>")
i = 1
Do
Response.write("www.ThaiCreate.Com<br>")
i = i + 1
Loop Until i = 5
%>