在ASP编程中遇到的循环问题

来源:百度知道 编辑:UC知道 时间:2024/06/26 05:54:18
<%
dim axj,bxj
axj=1
bxj=1
while axj=1
bxj=bxj+1
if bxj>10 then axj=2
wend
%>
这样写正确,把axj=2
换行写为什么报错啊
<%
dim axj,bxj
axj=1
bxj=1
while axj=1
bxj=bxj+1
if bxj>10 then
axj=2
wend
%>
错误为什么呢?

前面的if then是单行语句,后成的属于多行if
应该加end if

while axj=1
bxj=bxj+1
if bxj>10 then
axj=2 '这里是语句块,可以写多行
end if '必须要加上end if表示if选择结束。否则出错
wend