newntui/activex/groupscombo/src/groupscomboctl.cpp
void CGroupsComboCtrl::FillElementsList(void) {
CString serverQuery;
    // No need to fill any output server variable if the variable name wasn't set.
    if(m_OutputVar.GetLength()==0) return;

	// creating new temporary group which will store all operationd 
	// results.
    EvaluateSync(CString("group tmp __distmp__"));
    // If all elements button selected ...
    if((m_ControlsEnable==FALSE) || (m_OpTools.IsButtonChecked(IDB_ALL)!=0)) {
		MakeGroupsConcat(CString("__distmp__"));
    } else { 
	    // If intersect button selected
        if(m_OpTools.IsButtonChecked(IDB_INTERSECT)!=0) {
		   MakeGroupsConcat(CString("__distmp__"));
		   MakeGroupsIntersect(CString("__distmp__"));
		} else { // intersect END
	       // If diff button selected
           if(m_OpTools.IsButtonChecked(IDB_DIFF)!=0) {
			   // pass 1 : collecting all elements in a single group
			   MakeGroupsConcat(CString("__distmp__"));
			   // pass 2 : calculating elements intersection 
               EvaluateSync(CString("group tmp __distmp1__"));
               EvaluateSync(CString("group set __distmp1__ __distmp__"));
			   MakeGroupsIntersect(CString("__distmp1__"));
			   // pass 3 : calculating difference 
               EvaluateSync(CString("group subtract __distmp__ __distmp1__"));
			   // Removing group for temporary intersect stirage
	           EvaluateSync(CString("group delete __distmp1__"));
		   } 
		}
	}
    // coping data to the output variable
	serverQuery.Format("set %s [group get __distmp__]",m_OutputVar);
	EvaluateSync(serverQuery);

    // removing temporary group - all results are in the output variable now
	EvaluateSync(CString("group delete __distmp__"));
}
//-------------------------------------------------------------------------------------
// This private function will fill the output variable which name is given in the
// m_OutputVariable member, if any, with the results of group operation or with the
// elements in the current group if only one group selected.
//-------------------------------------------------------------------------------------
This private function will fill the output variable which name is given in the
m_OutputVariable member, if any, with the results of group operation or with the
elements in the current group if only one group selected.
This private function will fill the output variable which name is given in the m_OutputVariable member if any with the results of group operation or with the elements in the current group if only one group selected .
void CGroupsComboCtrl::FillElementsList(void) {
CString serverQuery;
    if(m_OutputVar.GetLength()==0) return;
    EvaluateSync(CString("group tmp __distmp__"));
    if((m_ControlsEnable==FALSE) || (m_OpTools.IsButtonChecked(IDB_ALL)!=0)) {
		MakeGroupsConcat(CString("__distmp__"));
    } else { 
        if(m_OpTools.IsButtonChecked(IDB_INTERSECT)!=0) {
		   MakeGroupsConcat(CString("__distmp__"));
		   MakeGroupsIntersect(CString("__distmp__"));
		} else { 
           if(m_OpTools.IsButtonChecked(IDB_DIFF)!=0) {
			   MakeGroupsConcat(CString("__distmp__"));
               EvaluateSync(CString("group tmp __distmp1__"));
               EvaluateSync(CString("group set __distmp1__ __distmp__"));
			   MakeGroupsIntersect(CString("__distmp1__"));
               EvaluateSync(CString("group subtract __distmp__ __distmp1__"));
	           EvaluateSync(CString("group delete __distmp1__"));
		   } 
		}
	}
	serverQuery.Format("set %s [group get __distmp__]",m_OutputVar);
	EvaluateSync(serverQuery);
	EvaluateSync(CString("group delete __distmp__"));
}
void CGroupsComboCtrl :: FillElementsList ( void ) { CString serverQuery ; if ( m_OutputVar . GetLength ( ) == 0 ) return ; EvaluateSync ( CString ( " " ) ) ; if ( ( m_ControlsEnable == FALSE ) || ( m_OpTools . IsButtonChecked ( IDB_ALL ) != 0 ) ) { MakeGroupsConcat ( CString ( " " ) ) ; } else { if ( m_OpTools . IsButtonChecked ( IDB_INTERSECT ) != 0 ) { MakeGroupsConcat ( CString ( " " ) ) ; MakeGroupsIntersect ( CString ( " " ) ) ; } else { if ( m_OpTools . IsButtonChecked ( IDB_DIFF ) != 0 ) { MakeGroupsConcat ( CString ( " " ) ) ; EvaluateSync ( CString ( " " ) ) ; EvaluateSync ( CString ( " " ) ) ; MakeGroupsIntersect ( CString ( " " ) ) ; EvaluateSync ( CString ( " " ) ) ; EvaluateSync ( CString ( " " ) ) ; } } } serverQuery . Format ( " " , m_OutputVar ) ; EvaluateSync ( serverQuery ) ; EvaluateSync ( CString ( " " ) ) ; }
This private function will fill the output variable which name is given in the
m_OutputVariable member, if any, with the results of group operation or with the
elements in the current group if only one group selected.
This private function will fill the output variable which name is given in the m_OutputVariable member if any with the results of group operation or with the elements in the current group if only one group selected .
// No need to fill any output server variable if the variable name wasn't set. // creating new temporary group which will store all operationd  // results. // If all elements button selected ... // If intersect button selected // intersect END // If diff button selected // pass 1 : collecting all elements in a single group // pass 2 : calculating elements intersection  // pass 3 : calculating difference  // Removing group for temporary intersect stirage // coping data to the output variable // removing temporary group - all results are in the output variable now