Do While loop
Another useful looping construct is the Do While loop where the
number of interactions is not determined. The following example extracts
the current day of the month(1-31) and prints out a line for each
day.
<html>
<head>
<title>Do while</title>
</head>
<body>
<h1> Phone calls for this Month</h1></br>
<%
varRowCount=0
varTodayDate=day(now())
do while varRowCount<=varTodayDate
Response.write "for _________"
response.write "number of clients met was ___<br>"
varRowCount= varRowCount+1
loop
%>
</body>
</html>
How it works:
The day(now()) statement returns the day of the month, between 1
and 31. The do While loop then iterates from 0 to the day of the
month. The statements between the Do While and loop controls are
executed varTodayDate+1 times.
|