日期:2014-05-17  浏览次数:20961 次

一个if语句的问题
if Sright=0 and ((Sright1       or Sright2 or Sright3 or Sright4) <> (1 or 0)) then
response.write   "权限位置请输入1或0!............. "
response.end
end if
请问,为什么我的Sright=1时,我的输出还是 "权限位置请输入1或0!............. "
我哪里写错了?请高人指点

------解决方案--------------------
((Sright1 or Sright2 or Sright3 or Sright4) <> (1 or 0))
不能这么写

if Sright=0 and (Not CheckRight(Sright1) or Not CheckRight(Sright2) or Not CheckRight(Sright3) or Not CheckRight(Sright4)) then
response.write "权限位置请输入1或0!............. "
response.end
end if
Function CheckRight(RightS)
If RightS <> 0 And Right <> 1 Then
CheckRight=False
Else
CheckRight=True
End If
End Function