ASP中大于0小于3 怎么表示

来源:百度知道 编辑:UC知道 时间:2024/06/18 08:31:18
我有一个页面,需要判定20个数:X1 X2…………X20 是否都大于0小于3,应该怎么表示
那我不是要把20个变量一一打一遍?能不能再详细一点
比如:
if (x1>0)&&(X1<3) and (x2>0)&&(X2<3)…………then
再一个就是,要判定20个,中间应该用and,还是or
(完了有+分)

ASP没有&&来表示并的,只有and和or

如果你的那20个数是有规律的话,可以用个循环来做
应该是这样写的
<%
if (x1>0 or x1<3) and (x2>0 or x2<3) and ... and (x20>0 or x20<3) then
......
end if

%>

for i=1 to 20
if x&i>0 and x&i<3 then
erro=true
exit for
end if
next
if erro=true then
response.write "找到不符合条件的项目"
else
response.write "全部符合"
end if

大于0小于3 == 大于0 且 小于3
(x1 > 0) && (x1 < 3)