Fill_%SubList ROUTINE FREE(%ScreenFieldQueue) #SET(%SubListFixedRows,'0') #FOR(%ScreenFieldFix) List:%Secondary:Line = %ScreenFieldFix List:%Secondary:Ptr = 0 ADD(%ScreenFieldQueue) #SET(%SubListFixedRows,(%SubListFixedRows+1)) #ENDFOR #FIX(%Secondary,%SubList) #FIX(%File,%SecondaryTo) #FIX(%Relation,%Secondary) #SET(%SaveRelationKey,%RelationKey) #FOR(%RelationKeyField) #IF(NOT %RelationKeyFieldLink) #BREAK #ENDIF %RelationKeyField = %RelationKeyFieldLink #SET(%LastRelationKeyField,%RelationKeyField) #ENDFOR #FIX(%File,%Secondary) #FIX(%Key,%SaveRelationKey) #SET(%FoundLast,%Null) #FOR(%KeyField) #IF(NOT %FoundLast) #IF(%KeyField=%LastRelationKeyField) #SET(%FoundLast,'Y') #ENDIF #ELSE #IF(%KeyFieldSequence='ASCENDING') #IF(%SubList = %RevSubList1 OR %SubList = %RevSubList2) #! LEE CLEAR(%KeyField,1) #! LEE Reverse display order of SubList #ELSE #! LEE CLEAR(%KeyField,-1) #! LEE #ENDIF #! LEE #ELSE CLEAR(%KeyField,1) #ENDIF #ENDIF #ENDFOR SET(%SaveRelationKey,%SaveRelationKey) #INSERT(%SubListFillSubInit) #FOR(%Formula) #! LEE SubList Total #IF(UPPER(SUB(%FormulaClass,1,LEN(%SubList) + 4)) = 'SLT:' & UPPER(%SubList)) #! LEE %Formula = 0 #! LEE Clears total value #ENDIF #! LEE #ENDFOR #! LEE LOOP #IF(%SubList = %RevSubList1 OR %SubList = %RevSubList2) #! LEE PREVIOUS(%SubList) #! LEE Reverse display order of SubList #ELSE #! LEE NEXT(%SubList) #! LEE #ENDIF #! LEE #FIX(%Secondary,%SubList) #FIX(%File,%SecondaryTo) #FIX(%Relation,%Secondary) #FOR(%RelationKeyField) #IF(NOT %RelationKeyFieldLink) #BREAK #ENDIF IF %RelationKeyField <> %RelationKeyFieldLink THEN BREAK. #ENDFOR IF ERRORCODE() THEN BREAK. #FOR(%Formula) #! LEE SubList Filter #IF(UPPER(%FormulaClass) = 'SLF:' & UPPER(%SubList)) #! LEE IF ~%FormulaCondition #None<16>' List:%Secondary:Ptr = 0 ADD(%ScreenFieldQueue) . DISPLAY(?List:%Secondary) #FOR(%Formula) #! LEE SubList Total #IF(UPPER(SUB(%FormulaClass,1,LEN(%SubList) + 4)) = 'SLT:' & UPPER(%SubList)) #! LEE DISPLAY(?%Formula) #