Use Windows.pkg Class cIndexComboForm is a ComboForm Procedure Construct_Object Forward Send Construct_Object Set Label to "Index:" Set Label_Col_Offset to 35 Set Entry_State to False End_Procedure Procedure Combo_Fill_List Integer iMaxIndex iIndex iMaxSegment iSegment iField iDirection String sIndex sFieldName Integer iFile iStartIndexnumber Handle hDDObj Send Combo_delete_data Get Server to hDDObj If hDDObj Begin Get main_file of hDDObj to iFile Move "00: No index" to sIndex Send OnAddIndex 0 (&sIndex) Send Combo_Add_Item sIndex Get_Attribute DF_FILE_LAST_INDEX_NUMBER of iFile to iMaxIndex For iIndex from 1 to iMaxIndex Get_Attribute DF_INDEX_NUMBER_SEGMENTS of iFile iIndex to iMaxSegment If (iMaxSegment > 0) Begin Move (Right("00" + String(iIndex), 2)) to sIndex Move (sIndex + ": ") to sIndex For iSegment from 1 to iMaxSegment Get_Attribute DF_INDEX_SEGMENT_FIELD of iFile iIndex iSegment to iField Get_Attribute DF_FIELD_NAME of iFile iField to sFieldname Get_Attribute DF_INDEX_SEGMENT_DIRECTION of iFile iIndex iSegment to iDirection Move (sIndex + sFieldName) to sIndex If (iDirection = DF_DESCENDING) Move (sIndex + "(DEC)") to sIndex Move (sIndex + ", ") to sIndex Loop Move (Rtrim(sIndex)) to sIndex If (Right(sIndex, 1) = ",") Move (Remove(sIndex, Length(sIndex), 1)) to sIndex Send OnAddIndex iIndex (&sIndex) Send Combo_Add_Item sIndex End Loop End Get Combo_Item_Count to iMaxIndex If (iMaxIndex > 0) Begin Get_Attribute DF_FILE_PRIMARY_INDEX of iFile to iStartIndexnumber // TODO: Select the index that is the primary index. Set Value item 0 to (Combo_Value(Self, 0)) End End_Procedure Procedure OnChange String sIndex Integer iIndex Handle hDDObj Forward Send OnChange If (Focus(Desktop) = Self) Begin Get Server to hDDObj If hDDObj Begin Get Value item 0 to sIndex Move (Left(sIndex, 2)) to iIndex Send OnIndexChanged iIndex End End End_Procedure {MethodType = Event} Procedure OnIndexChanged Integer iIndex End_Procedure {MethodType = Event} Procedure OnAddIndex Integer iIndex String ByRef sComboValue End_Procedure Procedure Deactivating Send Combo_Delete_Data Forward Send Deactivating End_Procedure // Returns the current selected index. Function SelectedIndex Returns Integer Integer iIndex String sIndex Get Value item 0 to sIndex Move (Left(sIndex, 2)) to iIndex Function_Return iIndex End_Function End_Class