Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3271486
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:43:59+00:00 2026-05-17T18:43:59+00:00

I have an application in which some sides i am using Filter conditions,,But i

  • 0

I have an application in which some sides i am using Filter conditions,,But i dont know the meaningof usage of word
“recursive” in that filter conditions
Here is a bit of code

          // Indicates a recursive filter.  Only valid for object type property filters.
      private bool m_recursive = false;
------------------------
      /// <summary>
      /// Method to apply an object filter to an object.
      /// </summary>
      /// <param name="myObject">the object to which to apply the filter</param>
      /// <returns>true if the object passes the filter, false otherwise</returns>
      public bool Apply(DataModelObject myObject) 
      {


----------------------




      /// Method to apply a property filter
      /// </summary>
      /// <param name="myObject">the object to which to apply the filter</param>
      /// <param name="filteredType">type of the object to which to apply the filter</param>
      /// <returns>true if the object passes the property filter, false otherwise</returns>
      public bool Apply(DataModelObject myObject, Type filteredType)
      {




switch( FilterType )
                  {
                     case enumFilterType.regularExpr:
                     switch( Operator )
                     {
                        case enumOperator.eq:

------------------------------------
case enumFilterType.strExpr:
                     switch( Operator )
                     {
                        case enumOperator.eq:
-------------------------------------
case enumFilterType.objectFilt:
do
                           {
                              retval = ((ObjectFilter)m_filterValue).Apply(propVal);
                              myObject = propVal;
                              if (m_recursive && retval == false && myObject != null)
                              {
                                 propVal = (DataModelObject)prop.GetValue(myObject, null);
                              }
                              else
                              {
                                 myObject = null;
                              }
                           } while (myObject != null);
                        }
                        if( m_operator == enumOperator.ne )
                        {
                           retval = !retval;
                        }
-----------------------
      public object Clone()
      {
         clone.m_recursive = this.m_recursive;
         return clone;
      }

Can any one tell me why recursive false is using here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:43:59+00:00Added an answer on May 17, 2026 at 6:43 pm

    The important part of you code is this:

    do
    {
      retval = ((ObjectFilter)m_filterValue).Apply(propVal);
      myObject = propVal;
      if (m_recursive && retval == false && myObject != null)
      {
         propVal = (DataModelObject)prop.GetValue(myObject, null);
      }
      else
      {
         myObject = null;
      }
    } while (myObject != null);
    

    Basically, when the FilterType is objectFilt then the code goes into a do...while loop which is a loop of code that is always run at least once, because the recursing condition (in this case, myObject != null) is checked after the loop code has been executed once.

    If m_recursive is false then retval and myObject are ignored and myObject is set to null, so when the recursing condition is checked, it fails and the loop exits.

    If m_recursive is set to true, the setting myObject to null is determined by two things: myObject being null and retval being false.

    retval is set by m_filterValue.Apply(propVal). It’s not clear where propVal comes from.

    In case you’re unaware of what recursion is, it is where a piece of code causes its self to be run again. In your code, this is represented by the do...while loop.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a c++ application which logs to some file using log4cxx (RollingFile appender).
I have an application which tries to load some expected registry settings within its
We have the usual web.xml for our web application which includes some jsp and
I have an application in which most requests are submitted via AJAX, though some
I'm looking at building a Rails application which will have some pretty large tables
This is a Windows Forms application. I have a function which captures some mouse
I have an application which really should be installed, but does work fine when
I have an application which extracts data from an XML file using XPath. If
We have some COBOL programs in our financial applications which need to interact with
I have some applications (some native, some .NET) which use manifest files so that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.