Use Windows.pkg Use ChooseField.dg Use Mode.dg Use cCJGrid.pkg Use cCJGridColumn.pkg Use Structs\tsFilter.pkg Object oFilterSetup is a ModalPanel Property tsFilter[] plsFilter Property Boolean pbOk Set Border_Style to Border_Thick Set Minimize_Icon to FALSE Set Label to "Filter setup" Set Location to 2 3 Set Size to 89 242 Set piMinSize to 82 206 Object oFilterList is a cCJGrid Set Size to 63 237 Set Location to 2 2 Set pbAllowColumnRemove to False Set pbAllowColumnReorder to False Set peAnchors to anAll Set pbDrawGridForEmptySpace to False Set pbEditOnClick to True Set pbEditOnKeyNavigation to True Object oField is a cCJGridColumn Set piWidth to 100 Set psCaption to "Field" Set Prompt_Button_Mode to PB_PromptOn Set Prompt_Object to oChooseField End_Object Object oMode is a cCJGridColumn Set piWidth to 47 Set psCaption to "Mode" Set Prompt_Button_Mode to PB_PromptOn Set pbCapslock to True Procedure Prompt String sMode sValue sField Boolean bOk Get SelectedRowValue to sMode Get SelectedRowValue of oValue to sValue Get SelectedRowValue of oField to sField Get SelectMode of oMode_dg sField (&sValue) (&sMode) to bOk If bOk Begin Send UpdateCurrentValue sMode Send UpdateCurrentValue of oValue sValue End End_Procedure End_Object Object oValue is a cCJGridColumn Set piWidth to 70 Set psCaption to "Value" End_Object Procedure Activating Forward Send Activating Send DoFillGrid End_Procedure Procedure DoFillGrid Integer iRow iMaxRows Integer iFieldCol iModeCol iValueCol tsFilter[] lsFilter tDataSourceRow[] lsData Get piColumnId of oField to iFieldCol Get piColumnId of oMode to iModeCol Get piColumnId of oValue to iValueCol Get plsFilter to lsFilter Move (SizeOfArray(lsFilter)) to iMaxRows For iRow from 0 to (iMaxRows - 1) Move lsFilter[iRow].sField to lsData[iRow].sValue[iFieldCol] Move lsFilter[iRow].sMode to lsData[iRow].sValue[iModeCol] Move lsFilter[iRow].sValue to lsData[iRow].sValue[iValueCol] Loop Send InitializeData lsData Send MovetoFirstRow End_Procedure Procedure MakeFilterList Integer iRow iMaxRows iCurFilter Integer iFieldCol iModeCol iValueCol tsFilter[] lsFilter tDataSourceRow[] lsData Handle hoDataSource Get piColumnId of oField to iFieldCol Get piColumnId of oMode to iModeCol Get piColumnId of oValue to iValueCol Get phoDataSource to hoDataSource Get DataSource of hoDataSource to lsData Move (SizeOfArray(lsData)) to iMaxRows For iRow from 0 to (iMaxRows - 1) If (lsData[iRow].sValue[iFieldCol] <> "") Begin Move lsData[iRow].sValue[iFieldCol] to lsFilter[iCurFilter].sField Move lsData[iRow].sValue[iModeCol] to lsFilter[iCurFilter].sMode Move lsData[iRow].sValue[iValueCol] to lsFilter[iCurFilter].sValue Increment iCurFilter End Loop Set plsFilter to lsFilter End_Procedure Procedure OnEnterKey Forward Send OnEnterKey Send Request_Save If (not(Err)) Begin Send KeyAction of oOK_btn End End_Procedure End_Object Object oOK_btn is a Button Set Label to "&OK" Set Location to 70 126 Set peAnchors to anBottomRight Procedure OnClick Send MakeFilterList of oFilterList Set pbOK to True Send Close_Panel End_Procedure End_Object Object oCancel_btn is a Button Set Label to "&Cancel" Set Location to 70 185 Set peAnchors to anBottomRight Procedure OnClick Send Close_Panel End_Procedure End_Object Function SelectFilters tsFilter[] ByRef lsFilter Returns Boolean Boolean bOk Set plsFilter to lsFilter Set pbOK to False Send Popup Get pbOk to bOk If bOk Begin Get plsFilter to lsFilter End Function_Return bOk End_Function End_Object