// Dynamic DataDictionary use for AnyFlex Use DataDict.pkg Use Constants\ConstantModes.pkg Use Structs\tsFilter.pkg Class Anyflex_DataDictionary is a DataDictionary Procedure Construct_Object Forward Send Construct_Object // Filterset Property tsFilter[] plsFilter // Activate or deactivate the filterset Property Boolean pbFilterActive False End_Procedure Function UpperConstrain Returns Boolean String sTestValue Integer iFile iField iMaxItems iItem Integer iCountUpper iUpperTrue tsFilter[] lsFilter Get Main_file to iFile Get plsFilter to lsFilter Move (SizeOfArray(lsFilter)) to iMaxItems Move 0 to iItem While (iItem < iMaxItems) Case Begin Case (lsFilter[iItem].sMode = C_FilterMode_ContainsCaseInsensitive) Field_Map iFile lsFilter[iItem].sField to iField Get_Field_Value iFile iField to sTestValue Increment iCountUpper If (Uppercase(sTestValue) Contains Uppercase(lsFilter[iItem].sValue)) Increment iUpperTrue Case Break Case (lsFilter[iItem].sMode = C_FilterMode_NotContainsCaseInsensitive) Field_Map iFile lsFilter[iItem].sField to iField Get_Field_Value iFile iField to sTestValue Increment iCountUpper If (not(Uppercase(sTestValue) Contains Uppercase(lsFilter[iItem].sValue))) Increment iUpperTrue Case Break Case End Increment iItem Loop Function_Return (iCountUpper = iUpperTrue) End_Function Procedure OnConstrain Integer iMaxItems iItem iField iFile String sValue tsFilter[] lsFilter Boolean bActive Forward Send OnConstrain Get pbFilterActive to bActive If (not(bActive)) Procedure_Return Get Main_file to iFile Get plsFilter to lsFilter Move (SizeOfArray(lsFilter)) to iMaxItems Move 0 to iItem While (iItem < iMaxItems) Field_Map iFile lsFilter[iItem].sField to iField Case Begin Case (lsFilter[iItem].sMode = C_FilterMode_Equal) Vconstrain iFile iField eq lsFilter[iItem].sValue Case Break Case (lsFilter[iItem].sMode = C_FilterMode_NotEqual) Vconstrain iFile iField ne lsFilter[iItem].sValue Case Break Case (lsFilter[iItem].sMode = C_FilterMode_LessThan) Vconstrain iFile iField lt lsFilter[iItem].sValue Case Break Case (lsFilter[iItem].sMode = C_FilterMode_LessThanOrEqualTo) Vconstrain iFile iField le lsFilter[iItem].sValue Case Break Case (lsFilter[iItem].sMode = C_FilterMode_GreaterThan) Vconstrain iFile iField gt lsFilter[iItem].sValue Case Break Case (lsFilter[iItem].sMode = C_FilterMode_GreaterThanOrEqualTo) Vconstrain iFile iField ge lsFilter[iItem].sValue Case Break Case (lsFilter[iItem].sMode = C_FilterMode_Contains) Vconstrain iFile iField Contains lsFilter[iItem].sValue Case Break Case (lsFilter[iItem].sMode = C_FilterMode_Matches) Vconstrain iFile iField Matches lsFilter[iItem].sValue Case Break Case (lsFilter[iItem].sMode = C_FilterMode_ContainsCaseInsensitive or lsFilter[iItem].sMode = C_FilterMode_NotContainsCaseInsensitive) Vconstrain iFile as (UpperConstrain(Self)) Case Break Case Else Send UserError "Wrong filterset." "" Procedure_Return Case Break Case End Increment iItem Loop End_Procedure End_Class