//AB/ Project Index list //AB/ Object prj is a Dialog_Project //AB/ Set ProjectName to "Index list" //AB/ Set ProjectFileName to "GlbIndexList.dg" // Project Object Structure // oIndexLookUp is a ModalPanel // index_list is a List // OOK_bn is a Button // OCancel_bn is a Button // Register all objects Register_Object index_list Register_Object OCancel_bn Register_Object OOK_bn Register_Object oIndexLookUp //AB-StoreTopStart Use GLBINDEXLIST.dg //AB-StoreTopEnd //AB-IgnoreStart Use Windows.pkg //AB-IgnoreEnd CD_Popup_Object oIndexLookUp is a ModalPanel //AB-StoreTopStart Set Minimize_Icon to TRUE On_Key KEnter Send KeyEnter Procedure KeyEnter Send Move_Value_Out To (Index_list(Current_Object)) End_Procedure //AB-StoreTopEnd Set Label to "Indexes" Set Location to 4 5 Set Size to 148 335 //AB-DDOStart //AB-DDOEnd Object index_list is a List Set Size to 105 320 Set Location to 6 6 //AB-StoreStart Procedure Activating Forward Send Activating Send delete_data Send load_list End_Procedure Procedure Mouse_Click Integer iWin integer iChar Forward Send Mouse_Click iWin iChar Send Move_value_out End_Procedure Procedure load_list string sField# sFieldName sSegFieldNames integer iSeg# iSegments iIndex# iFile# iLastIndex Move FileNumber to iFile# get_Attribute DF_FILE_LAST_INDEX_NUMBER of iFile# to iLastIndex //-----------------------------------------------------> // Build a list of indexes and their segments //-----------------------------------------------------> For iIndex# From 0 to iLastIndex get_attribute DF_INDEX_NUMBER_SEGMENTS of iFile# iIndex# to iSegments Move "" to sSegFieldNames For iSeg# From 1 to iSegments get_Attribute DF_INDEX_SEGMENT_FIELD of iFile# iIndex# iSeg# to sField# get_Attribute DF_FIELD_NAME of iFile# sField# to sFieldName If (iSeg# < iSegments) Move (sSegFieldNames+sFieldName+", ") to sSegFieldNames Else Move (sSegFieldNames+sFieldName) to sSegFieldNames Loop SEND add_item msg_none sSegFieldNames Loop End_Procedure Procedure Move_Value_out integer iRC iPos String sSegments //--------------------------------------------> // Grab the first segment of the selected index //--------------------------------------------> Get current_item to iRC Get Value Item iRC To sSegments Set piIndex# Of (oReplace_View(Current_Object)) To iRC Move (Pos( ",",sSegments)) To iPos Set psIndex_Segment Of (oReplace_View(Current_Object)) To (Left(sSegments, (iPos-1))) Send Close_Panel End_Procedure //AB-StoreEnd End_Object // index_list Object OOK_bn is a Button Set Label to "&Ok" Set Location to 115 16 //AB-StoreStart Procedure OnClick Send Move_Value_Out To (Index_List(Current_Object)) End_Procedure //AB-StoreEnd End_Object // OOK_bn Object OCancel_bn is a Button Set Label to "&Cancel" Set Location to 115 71 //AB-StoreStart Procedure OnClick Send Close_Panel End_Procedure //AB-StoreEnd End_Object // OCancel_bn CD_End_Object // oIndexLookUp //AB-StoreStart //AB-StoreEnd //AB/ End_Object // prj