$WBCASE - select case (switch)

$WBCASE is available for use with all WBSP commands.


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

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


Random number $WBCASE[,|$wbfn[rnd(50)]|
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]

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.