References the value of a field in a frame. For example, if you use the PROMPT-FOR statement to get input from the user, PROMPT-FOR stores that information in the screen buffer. You can use the INPUT function to refer to that information.
This procedure displays the current CreditLimit for a Customer. The PROMPT-FOR statement prompts the user for a new CreditLimit value and stores the supplied data in the screen buffer. The procedure uses the INPUT function to point to the data in that buffer.
r-input.p
FOR EACH Customer:
DISPLAY Customer.CustNum Customer.Name Customer.CreditLimit
LABEL "Current credit limit"
WITH FRAME a 1 DOWN ROW 1.
PROMPT-FOR Customer.CreditLimit LABEL "New credit limit"
WITH SIDE-LABELS NO-BOX ROW 10 FRAME b.
IF INPUT FRAME b Customer.CreditLimit <> Customer.CreditLimit THEN DO:
DISPLAY "Changing max credit of" Customer.Name SKIP
"from" Customer.CreditLimit "to" INPUT FRAME b Customer.CreditLimit
WITH FRAME c ROW 15 NO-LABELS.
Customer.CreditLimit = INPUT FRAME b Customer.CreditLimit.
END.
ELSE DISPLAY "No change in credit limit" WITH FRAME d ROW 15.
END.
|
If the user enters a new value, the procedure displays a message that the value has been changed. If the user enters the same value, the procedure displays a message that the credit-limit has not been changed.