Case statement

Code:
DEFINE VARIABLE pay-stat AS INTEGER NO-UNDO INITIAL 1.

UPDATE pay-stat VIEW-AS RADIO-SET
  RADIO-ITEM unpaid   1 LABEL "Unpaid"
  RADIO-ITEM part     2 LABEL "Partially paid"
  RADIO-ITEM paid     3 LABEL "Paid in full"
.

CASE pay-stat:
  WHEN 1 THEN    MESSAGE "This account is unpaid.".
  WHEN 2 THEN    MESSAGE "This account is partially paid.".
  WHEN 3 THEN    MESSAGE "This account is paid in full.".
END CASE.
 
Hello guy,i hope that example can help you.
Any doubt let me know.
Jefferson

DEFINE VARIABLE cont AS INT NO-UNDO INIT 1 .
DEFINE VARIABLE aux AS DEC NO-UNDO EXTENT 4.

DO WHILE cont < 5:
CASE cont:
WHEN 1 THEN aux[1] = cont * cont + 1 .
WHEN 2 THEN aux[2] = cont * cont + 2 .
WHEN 3 THEN aux[3] = cont * cont + 3 .
WHEN 4 THEN aux[4] = cont * cont + 4 .
END CASE.

cont = cont + 1.

DISPLAY aux[1] SKIP
aux[2] SKIP
aux[3] SKIP
aux[4].
END.
 
This is the second question in a row where examples are readily available in the manual and in the help. You should get a set of manuals, if you don't have one, and use it and help *first* rather than going to the forum. If there is something you don't understand or a problem getting something to work, *then* come to the forums.
 
Back
Top