Progress
Language Reference


INPUT Function

Interfaces
OS
SpeedScript
All
All
No

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 window buffer. You can use the INPUT function to refer to that information.

SYNTAX

INPUT [ FRAME frame ] field 

FRAME frame

The name of the frame that contains the field named by the field argument. If you do not name a frame, the INPUT function starts with the current frame and searches outward until it finds the field you name with the field argument.

field

The name of a field or variable whose value is stored in the window buffer. The specified field must be viewed as a fill-in or text widget.

EXAMPLE

This procedure displays the current credit-limit for a customer. The PROMPT-FOR statement prompts the user for a new credit-limit value and stores the supplied data in the window buffer. The procedure uses the INPUT function to point to the data in that buffer.

r-input.p
FOR EACH CUSTOMER:
  DISPLAY cust-num name credit-limit LABEL "Current credit limit"
    WITH FRAME a 1 DOWN ROW 1.
  PROMPT-FOR credit-limit LABEL "New credit limit" WITH SIDE-LABELS
    NO-BOX ROW 10 FRAME b.
  IF INPUT FRAME b credit-limit <> credit-limit
  THEN DO:
    DISPLAY "Changing max credit of" name SKIP
            "from" credit-limit "to" INPUT FRAME b credit-limit
            WITH FRAME c ROW 15 NO-LABELS.
    credit-limit = INPUT FRAME b credit-limit.
  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.

NOTES


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095