Condition in Case of Select/Case statement in clas

2019-08-29 10:19发布

I've recently been tasked with updating a classic ASP page and have no experience in this language. Is it possible to write a condition into a Select statement's case like so:

Select Case <variable>
Case <value> && <if variable2 == something>
Case <value> || <if variable2 == something else>

标签: asp-classic
1条回答
唯我独甜
2楼-- · 2019-08-29 10:49

This uses comma syntax:

Case <value>, variable2 = something else   <--- case satisfies either condition.

You cannot build IF statements into the cases.

BTW: VBScript uses "and", "or" and "=", instead of "&&" "||" or "=="

Equal and assignment both use "=" and are context-dependent.

查看更多
登录 后发表回答