Drop-Down Lists

A control that is a variation of a list box. A drop-down list only displays one item until the user takes an action to display the other objects or choices.

One value at a time. Hard-coded values.

        DEFINE     FIELD(#DROPDATA) TYPE(*CHAR) LENGTH(10)

                     INPUT_ATR(DDST)

 

        USE        BUILTIN(DROP_DD_VALUES) WITH_ARGS(DDCO)

 

        USE        BUILTIN(ADD_DD_VALUES) WITH_ARGS(DDCO *DFT

                     'RED') TO_GET(#RETCD)

 

        USE        BUILTIN(ADD_DD_VALUES) WITH_ARGS(DDCO *DFT

                     'BLUE') TO_GET(#RETCD)

 

        USE        BUILTIN(ADD_DD_VALUES) WITH_ARGS(DDCO *DFT

                     'YELLOW') TO_GET(#RETCD)

 

        USE        BUILTIN(ADD_DD_VALUES) WITH_ARGS(DDCO *DFT

                     'GREEN') TO_GET(#RETCD)

 

        USE        BUILTIN(ADD_DD_VALUES) WITH_ARGS(DDCO *DFT

                     'WHITE') TO_GET(#RETCD)

 

Many values at once, separated by the defined separator character.

        DEFINE     FIELD(#DROPDATA) TYPE(*CHAR) LENGTH(3)

                     INPUT_ATR(DDST)

 

        USE        BUILTIN(DROP_DD_VALUES) WITH_ARGS(DDST)

 

        USE        BUILTIN(ADD_DD_VALUES) WITH_ARGS(DDST '''/'''

                     'NSW/VIC/QLD/SA/WA/NT/TAS') TO_GET(#RETCD)

 

One value at a time, loaded from a file.

        DEFINE     FIELD(#DROPDATA) TYPE(*CHAR) LENGTH(24)

                     INPUT_ATR(DDCT)

        OVERRIDE   FIELD(#CATEGORY) TO_OVERLAY(#DROPDATA 1)

        OVERRIDE   FIELD(#CATDESC) TO_OVERLAY(#DROPDATA 5)

 

        USE        BUILTIN(DROP_DD_VALUES) WITH_ARGS('DDCT')

 

        SELECT     FIELDS((#CATEGORY) (#CATDESC))

                     FROM_FILE(CATMST)

 

        USE        BUILTIN(ADD_DD_VALUES) WITH_ARGS('DDCT' *DFT

                     #DROPDATA)

 

        ENDSELECT