Kbase P56988: How to achieve range using the CASE statement
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  7/9/2004 |
|
Status: Unverified
GOAL:
How to achieve range using the CASE statement
GOAL:
How to use less-than and greater-than operators in a CASE statement
GOAL:
How to use range as condition for the execution of a CASE branch
FIX:
You have to use the TRUE as expression for the CASE statement and move the whole range condition after the WHEN. Look the example below.
CASE TRUE:
WHEN (myInt < 0 ) THEN
MESSAGE "myInt is negative"
VIEW-AS ALERT-BOX INFO BUTTONS OK.
WHEN (myInt >= 0 AND myInt < 10) THEN
MESSAGE "myInt is between 0 and 9"
VIEW-AS ALERT-BOX INFO BUTTONS OK.
WHEN (myInt >= 10 AND myInt < 20) THEN
MESSAGE "myInt is between 10 - 19"
VIEW-AS ALERT-BOX INFO BUTTONS OK.
OTHERWISE
MESSAGE "myInt above 19"
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END CASE.