Consultor Eletrônico



Kbase 19746: 4GL. Simple Program to Display Pop-Up Browse from Fill-In
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   31/01/2005
Status: Unverified

GOAL:

Simple Program to Display Pop-Up Browse from Fill-In

FACT(s) (Environment):

Progress 7.X
Progress 8.X
Progress 9.X
4GL

FIX:

To use the program, run it against the Sports database, then press the question mark(?) key. This will launch a browse sorted by customer name.

Select the customer you want and press return. You can filter the customers displayed in the browse by typing the first character(s) of the customer name in the fill-in before pressing the question mark(?) key.

/* popUpBrowse.p */
DEFINE VARIABLE cFillIn AS CHARACTER FORMAT "x(45)"
VIEW-AS FILL-IN SIZE 44.1 BY 1
LABEL "Customer Name"
NO-UNDO.
DEFINE VARIABLE paramValue AS CHARACTER NO-UNDO.

DEFINE FRAME xx cFillIn WITH TITLE "Search Customer Name...".
STATUS INPUT "Enter Customer Name or hit Question Mark(?)...".

ON "?" OF cFillIn DO:

ASSIGN paramValue = SELF:SCREEN-VALUE NO-ERROR.
RUN browseFrame ( INPUT-OUTPUT paramValue ).
IF paramValue <> "Cancel" THEN
ASSIGN SELF:SCREEN-VALUE = paramValue NO-ERROR.
RETURN NO-APPLY.

END.

ENABLE ALL WITH FRAME xx.

WAIT-FOR CLOSE OF THIS-PROCEDURE.

PROCEDURE browseFrame:

DEFINE INPUT-OUTPUT PARAMETER paramValue AS CHARACTER NO-UNDO.

DEFINE QUERY qCust FOR Customer SCROLLING.
DEFINE BROWSE bCust QUERY qCust
DISPLAY Name
Cust-Num
Sales-Rep
WITH 14 DOWN NO-BOX.
DEFINE FRAME xy bCust WITH OVERLAY TITLE "Select Customer..."
VIEW-AS DIALOG-BOX.

ON VALUE-CHANGED OF bCust IN FRAME xy DO:
ASSIGN paramValue = Customer.Name:SCREEN-VALUE IN BROWSE bCust.
END.

ON "END-ERROR" ANYWHERE DO:
ASSIGN paramValue = "Cancel".
END.

ENABLE bCust WITH FRAME xy.
OPEN QUERY qCust FOR EACH Customer WHERE Name BEGINS paramValue
NO-LOCK BY Name.
ASSIGN paramValue = Customer.Name:SCREEN-VALUE IN BROWSE bCust.

WAIT-FOR DEFAULT-ACTION OF bCust.
HIDE FRAME xy.

END PROCEDURE.