根据指定的条件写if语句

漠叔 2017-04-11 09:43:23
有个If语句,如下格式
If getok(t)=True and classid=2 and money<1000 then
xxxxx
End if

现在想设置多个条件,If (getok(t)=True and classid=2 and money<1000) or (getok(t)=True and classid=3 and money<800)...

但这样写不方便后期修改,怎么写成下面这种形式,后期维护方便点,

满足以下任一条件,即可xxxx
条件1=True,2,1000
条件2=True,3,800
条件3=True,5,9000
...........

If 【这里应该怎么写?】 then
xxxxx
End if
...全文
232 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
Msxindl_Com 2017-04-12
  • 打赏
  • 举报
回复

<%
dim flag : flag=false
if getok(t)=True then
	if classid=2 and money<1000 then flag=true
	if classid=3 and money<800 then flag=true
	if classid=5 and money<9000 then flag=true
end if
response.write flag
if flag then
	'XXXXX
end if
%>

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧