Consultor Eletrônico



Kbase 13971: Using SELECTION LIST SCREEN-VALUE to do a db FOR EACH
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
Using SELECTION LIST SCREEN-VALUE to do a db FOR EACH


If a program needs to let a user choose items from a SELECTION LIST
and then use this to do a db FOR EACH (especially if choosing multiple
selections), use the following code sample as a starting point. Note
that in this example, only the matching countries will cause a search
of the db (e.g., when two entries are chosen AND one is "USA" or
"FINLAND").

DEF VAR s AS CHAR.

s = SELECT-1:SCREEN-VALUE IN FRAME frame-a.
CASE NUM-ENTRIES(s):
WHEN 1 THEN FOR EACH customer WHERE customer.country = s:
END.
WHEN 2 THEN FOR EACH customer WHERE customer.country = ENTRY (1,s)
OR customer.country = ENTRY (2,s):
END.
WHEN 3 THEN FOR EACH customer WHERE customer.country = ENTRY (1,s)
OR customer.country = ENTRY (2,s)
OR customer.country = ENTRY (3,s):
END.
:
:
END CASE.

Progress Software Technical Support Note # 13971