VB找错在线等

来源:百度知道 编辑:UC知道 时间:2024/06/18 10:33:29
<%
dim b
b=15
if (b>0) and (b<12) then x=0
elseif b<18 then x=1
else b<24 then x=2
end if
response.Write(b)
%>
错误类型:
Microsoft VBScript 编译器错误 (0x800A03EA)
语法错误
/asp/dfs.asp, line 6
elseif b<18 then x=1

不行

正确代码应该这样写:
<%
dim b
b=15
if (b>0) and (b<12) then
x=0
elseif b<18 then
x=1
elseif b<24 then
x=2
end if
response.Write(b)
%>
if语句如有else配对,则then后面的语句要换行书写
else b<24 then x=2 该行语句中else也应为elseif

else b<24 then x=2
----------------->
else if b<24 then x=2