Evaluates a list of conditions and returns on of multiple possible result expressions.
1.Case - Name of the Macro.
2.Input - Value to test for matches.
3.WHEN - A constant value that indicates that the next parameter is the value to match against
4.match-expression - A value to compare against Input to determine if there is a match
5.THEN - A constant value that indicates that the next parameter is the value to return if the previous parameter was a match.
6.result-expression - A value to return if a match was detected
7.ELSE - (Optional) A constant value that indicates the next parameter is the value to return as no matches were made
8.default-expression - (Optional) A value to return if no match was made - only provide this value is ELSE is used.
Arguments 3 through 6 may be repeated as many times as are necessary.
Returns the word January in the first month, the word December in the 12th month, and Neither for any other month.
Returns the word January in the first month, the word December in the 12th month, and no value for any other month.
There is no limit to the number of WHEN-expression-THEN-expression clauses that you include in the macro.
Copyright © 2023 pasUNITY, Inc.
Send comments on this topic.