asp循环语句总结(asagsh循环)满满干货

随心笔谈11个月前发布 admin
92 0


<body>
do while….loop<br />
<%
‘do while….loop 类似.net中的while(){}
i=6
Do while i < 10
response.Write(i&”<br>”)
i=i+1
Loop
%>
do ….loop until<br />
<%
‘do while….loop 类似.net中的while(){}
i=6
Do
response.Write(i&”<br>”)
i=i+1
Loop until i < 10
%>
while….wend <br />
<%
i=10
while i<20
response.Write(i&”<br>”)
i=i+1
wend
%>
For…Next<br />
<%
for i=0 to 10 ‘ 包括0到10
response.Write(i&”<br>”)
if i=5 then
exit for
end if
next
%>

For…..each….next<br />
<%
dim array(3)
array(1)=”A”
array(2)=”B”
array(3)=”C”
for each a in array
response.Write(a&”<br>”)
next
%>
</body>
</html>

© 版权声明

相关文章