问题
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