S
sri
Guest
when i enter 4 at the runtime ,the following program should return me the string"four" and similarly the string`s corresponding to 5,6,7 and 8.
this should be done using entry function.
DEFINE VARIABLE x AS CHARACTER NO-UNDO FORMAT "9" LABEL "Enter a digit between 4 and 8".
DEFINE VARIABLE show AS CHARACTER NO-UNDO FORMAT "x(5)" EXTENT 5 LABEL "Literal" INITIAL ["four","five","six","seven","eight"].
define variable i as integer .
REPEAT:
SET x AUTO-RETURN.
IF lookup("4","5","6","7","8",x,",") = 0
THEN
DO:
MESSAGE "Digit must be 4,5,6,7, or 8. Try again.".
UNDO, RETRY.
END.
ELSE
MESSAGE /*show[INDEX("45678",x)]*/
entry(lookup("eight",show[x],"," ))
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.
Continue reading...
this should be done using entry function.
DEFINE VARIABLE x AS CHARACTER NO-UNDO FORMAT "9" LABEL "Enter a digit between 4 and 8".
DEFINE VARIABLE show AS CHARACTER NO-UNDO FORMAT "x(5)" EXTENT 5 LABEL "Literal" INITIAL ["four","five","six","seven","eight"].
define variable i as integer .
REPEAT:
SET x AUTO-RETURN.
IF lookup("4","5","6","7","8",x,",") = 0
THEN
DO:
MESSAGE "Digit must be 4,5,6,7, or 8. Try again.".
UNDO, RETRY.
END.
ELSE
MESSAGE /*show[INDEX("45678",x)]*/
entry(lookup("eight",show[x],"," ))
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.
Continue reading...