Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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
Defining, Adding Entries To and Displaying a Browse List
Defining, Adding Entries To and Displaying a Browse List
Defining, Adding Entries To and Displaying a Browse List

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
Filling a Browse List with Information from a Database File
Filling a Browse List with Information from a Database File
Filling a Browse List with Information from a Database File

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
Adding Entries to the Beginning or End of a Browse List
Adding Entries to the Beginning or End of a Browse List
Adding Entries to the Beginning or End of a Browse List

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
Sorting Entries in Browse Lists by Using a Working List
Sorting Entries in Browse Lists by Using a Working List
Sorting Entries in Browse Lists by Using a Working List

This example asks the user to input sets of employee details.

...