Page History
7.2.3 ADD_ENTRY Examples
Defining, Adding Entries To and Displaying a Browse List
Filling a Browse List with Information from a Database File
Adding Entries to the Beginning or End of a Browse List
Sorting Entries in Browse Lists by Using a Working List
| Anchor | ||||
|---|---|---|---|---|
|
To define, add two entries to and display a browse list named #EMPBROWSE you would use these commands like this:
DEF_LIST NAME(#EMPBROWSE) FIELDS(#EMPNO #GIVENAME #SURNAME)
CHANGE #EMPNO 'A0001'
CHANGE #GIVENAME 'JOHN'
CHANGE #SURNAME 'SMITH'
ADD_ENTRY TO_LIST(#EMPBROWSE)
CHANGE #EMPNO 'A0002'
CHANGE #GIVENAME 'MARY'
CHANGE #SURNAME 'BROWN'
ADD_ENTRY TO_LIST(#EMPBROWSE)
DISPLAY BROWSELIST(#EMPBROWSE)
| Anchor | ||||
|---|---|---|---|---|
|
This example asks the user to input a department code (eg: ADM, MKT, etc).
...
DEF_LIST NAME(#EMPBROWSE) FIELDS(#SECTION #EMPNO #SURNAME #GIVENAME)
BEGIN_LOOP
REQUEST FIELDS(#DEPTMENT) BROWSELIST(#EMPBROWSE)
CLR_LIST NAMED(#EMPBROWSE)
SELECT FIELDS(#EMPBROWSE) FROM_FILE(PSLMST1) WITH_KEY(#DEPTMENT)
ADD_ENTRY TO_LIST(#EMPBROWSE)
ENDSELECT
END_LOOP
| Anchor | ||||
|---|---|---|---|---|
|
This example asks the user to input sets of employee details.
...
SUBROUTINE NAME(VISIBLE)
CLR_LIST #EMPBROWSE
SELECTLIST NAMED(#EMPWORKNG)
ADD_ENTRY TO_LIST(#EMPBROWSE)
ENDSELECT
ENDROUTINE
| Anchor | ||||
|---|---|---|---|---|
|
This example asks the user to input sets of employee details.
...