Set Up Picklists
Before you add the entry with picklist, you need to create a collection of picklists, a collection of picklist items and two subroutines, one to add the picklists and one to add the items to the collections.These collections and subroutines handle all the picklists in the property sheet:
1. Create a collection of picklists (#PRIM_PKLT components):
DEFINE_COM class(#PRIM_KCOL) name(#PL_COL) collects(#PRIM_PKLT) keyedby(#STD_COUNT)
2. Create a collection of picklist items (#PRIM_PKIT components):
DEFINE_COM class(#PRIM_KCOL) name(#PI_COL) collects(#PRIM_PKIT) keyedby(#STD_COUNT)
3. Assign index numbers to identify the pick lists and the pick list items:
DEFINE_COM class(#STD_COUNT) name(#CUR_PLIST)
DEFINE_COM class(#STD_COUNT) name(#CUR_PITEM)
4. Create a subroutine which creates new picklists by assigning a new index number to the collection:
SUBROUTINE name(ADD_PLIST)
CHANGE field(#CUR_PLIST) to('#Cur_Plist + 1')
ENDROUTINE
5. Create a subroutine which creates new picklist items by assigning them index numbers and associates the items with the current picklist:
SUBROUTINE name(ADD_PITEM) parms((#PROPERTY *RECEIVED) (#VALUE *RECEIVED))
CHANGE field(#CUR_PITEM) to('#Cur_PItem + 1')
* Set the caption and the value of the item plus assign it into the Picklist
SET com(#PI_Col<#Cur_PItem>) caption(#property) default(True) value(#value) parent(#PL_COL<#Cur_PList>)
ENDROUTINE
You can copy the code which sets up picklists from Picklist Code You Can Copy.