PreviousNextIndex

PROMPT-FOR statement

Requests input and places that input in the screen buffer (frame).

The PROMPT-FOR statement is a combination of the following statements:

Data movement

Syntax

PROMPT-FOR  
  [ STREAM stream | STREAM-HANDLE handle ] 
  [ UNLESS-HIDDEN ] 
  {     { field 
            [ format-phrase ] 
            [ WHEN expression ] 
        } 
     |  { TEXT ( { field 
                     [ format-phrase ] 
                     [ WHEN expression ] 
                 } ... 
               ) 
        } 
     |  { constant 
            [ { AT | TO } n ]  
            [ VIEW-AS TEXT ] 
            [ FGCOLOR expression ] 
            [ BGCOLOR expression ] 
            [ FONT expression ] 
        } 
     |  SPACE [ ( n ) ]  |  SKIP [ ( n ) ]  |  ^  
  } ...  
  [ GO-ON ( key-label ... ) ] 
  [ IN WINDOW window ] 
  [ frame-phrase ] 
  [ editing-phrase ] 

PROMPT-FOR 
  [ STREAM stream | STREAM-HANDLE handle ] 
  [ UNLESS-HIDDEN ] 
  record [ EXCEPT field ... ]  
  [ IN WINDOW window ] 
  {  [ frame-phrase ] } 

STREAM stream
STREAM-HANDLE handle
UNLESS-HIDDEN
field
format-phrase
WHEN expression
TEXT
constant [ AT n | TO n ] [ VIEW-AS TEXT ] [ FGCOLOR expression ]
[ BGCOLOR expression ] [ FONT expression ]
SPACE [ ( n ) ]
SKIP [ ( n ) ]
^
GO-ON ( key-label . . . )
IN WINDOW window
frame-phrase
editing-phrase
record
EXCEPT field
Examples

The r-prmpt.p procedure requests a customer number from the user and stores that number in the screen buffer. The FIND statement reads a record from the Customer database table.

r-prmpt.p
REPEAT: 
  PROMPT-FOR Customer.CustNum. 
  FIND Customer USING Customer.CustNum NO-ERROR. 
  IF NOT AVAILABLE Customer THEN DO: 
    MESSAGE "No such customer number.". 
    UNDO, RETRY. 
  END. 
  DISPLAY Customer.Name Customer.Phone Customer.SalesRep. 
END. 

The r-prmpt2.p procedure requests the initials of a sales representative and stores those initials in the screen buffer. The FIND statement uses the initials stored in the screen buffer to read a record from the SalesRep database table. After finding the record, the procedure displays sales rep information.

r-prmpt2.p
REPEAT: 
  PROMPT-FOR SalesRep.SalesRep LABEL "Sales rep’s initials" 
    WITH FRAME namefr ROW 2 SIDE-LABELS. 
  FIND SalesRep NO-LOCK USING SalesRep.SalesRep. 
  DISPLAY SalesRep.RepName SalesRep.Region SalesRep.MonthQuota  
    WITH 1 DOWN NO-HIDE. 
END. 

Notes
See also

DEFINE STREAM statement, EDITING phrase, Format phrase, Frame phrase, Stream object handle


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex