// Dynamic DataDictionary use for AnyFlex Use DataDict.pkg Struct tsFilter String sField String sMode String sValue End_Struct 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 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 = "UPPER") 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 = "NOTUPPER") 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 = "EQ") Vconstrain iFile iField eq lsFilter[iItem].sValue Case Break Case (lsFilter[iItem].sMode = "NE") Vconstrain iFile iField ne lsFilter[iItem].sValue Case Break Case (lsFilter[iItem].sMode = "LT") Vconstrain iFile iField lt lsFilter[iItem].sValue Case Break Case (lsFilter[iItem].sMode = "LE") Vconstrain iFile iField le lsFilter[iItem].sValue Case Break Case (lsFilter[iItem].sMode = "GT") Vconstrain iFile iField gt lsFilter[iItem].sValue Case Break Case (lsFilter[iItem].sMode = "GE") Vconstrain iFile iField ge lsFilter[iItem].sValue Case Break Case (lsFilter[iItem].sMode = "CONTAINS") Vconstrain iFile iField Contains lsFilter[iItem].sValue Case Break Case (lsFilter[iItem].sMode = "MATCHES") Vconstrain iFile iField Matches lsFilter[iItem].sValue Case Break Case (lsFilter[iItem].sMode = "UPPER" or lsFilter[iItem].sMode = "NOTUPPER") Vconstrain iFile as (UpperConstrain(Self)) Case Break Case Else Send info_Box "Wrong filterset!" Procedure_Return Case Break Case End Increment iItem Loop End_Procedure End_Class