I find the PowerScript's CHOOSE CASE
statement very useful, as it make so that the code is more clearly than a lot of if
s and else if
s.
Here a example of how it works, from the above link:
CHOOSE CASE weight
CASE IS < 16
Postage=Weight*0.30
Method="USPS"
CASE 16 to 48
Postage=4.50
Method="UPS"
CASE ELSE
Postage=25.00
Method="FedEx"
END CHOOSE
a CASE 5 to 11
is the same as CASE 5, 6, 7, 8, 9, 10, 11
Note that the CHOOSE CASE
is not equivalent to java's switch