Condition in Case of Select/Case statement in classic ASP

巧了我就是萌 提交于 2019-12-25 03:35:21

问题


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>

回答1:


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.



来源:https://stackoverflow.com/questions/15231204/condition-in-case-of-select-case-statement-in-classic-asp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!