Versions Compared

Key

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

...

The previous example that handled department number prompts would probably look like this (it does not use page at a time techniques because there are only 20 or so departments):   << define browse list and exchange list >>

      << define browse list and exchange list >>
 
        DEF_LIST  NAME(#DEPTS)

...

 FIELDS(#DEPTNO #DEPTDESC)
                  SEL_ENTRY(#CURSORSEL)
        EXCHANGE  FIELDS(#DEPTS)

...

 OPTION(*ALWAYS)
 

...

     << clear list and place details of all departments into it  >>
 
        CLR_LIST  NAMED(#DEPTS)
        SELECT    FIELDS(#DEPTS)

...

 FROM_FILE(DEPTFILE)
        ADD_

...

ENTRY TO_LIST(#DEPTS)
        ENDSELECT
 

...

     << Display list in pop-up window until user selects or cancels >>
 
        CHANGE    FIELDS(#DEPTS)

...

 TO(*NULL)
        DOUNTIL   COND('

...

#CURSORSEL *GT 0')
        POP_UP    BROWSELIST(#DEPTS)

...

 CURSOR_LOC(*

...

ATFIELD #DEPTNO)
                  EXIT_KEY(*NO)

...

 MENU_KEY(*

...

YES *RETURN)
        IF       COND('

...

#CURSORSEL *GT 0')
        GET_

...

ENTRY NUMBER(#CURSORSEL)

...

 FROM_LIST(#DEPTS)
        ENDIF
        ENDUNTIL
        RETURN