$WBCASE - select case (switch)

Availability
$WBCASE is available for use with all WBSP commands.

Syntax
$WBCASE{separator|value|conditionlist|resultlist|default}
$WBCASE[separator|value|conditionlist|resultlist|default]

Parameters
separator - a character used to separate elements of conditionlist and resultlist. Default value is comma (,)
value - value that will be compared
conditionlist - list of conditions in form operator value (e.g. =3,>5,<>7), separated with separator
resultlist - list of return values for each condition, separated by separator
default - value that will be returned if none of the conditions is true

Returns
Code contained in true part or false part depending on result of evaluated expression.

Example

<!--
[FormFields]
wb_command=r
-->
<!--WB_BeginTemplate-->
<html>
<head>
<title>Titles</title>
</head>
<body>
Random number $WBCASE[,|$wbfn[rnd(50)]|
=30,=10,=25,>=40,<10|
is 30,is 10,is 25,is greater or equal to 40, is less than 10|
is neither 10, 25, 30 nor it is greater than 40 or less than 10]
</body>
</html> 

After running this example, the resulting page in browser, may look like this:

Random number is greater or equal to 40

Refresh the page few times and watch the changes of the result.