troubleshooting Question

Using break but seeing no label text

Avatar of dba123
dba123 asked on
C#
3 Comments1 Solution192 ViewsLast Modified:
Ok, from one function I'm calling another.  In the called function, I want to halt further processing if I find certain values so I put in some breaks.  But I notice that even if the if statement evaluates to true and sets the label, I don't see the label on my page showing anything.   The label is just a standard web control.

The called function looks like this

       private bool  MyFunction(Grid myGrid)
        {
            bool blnReturn = true;

            for (int i = 0; i < ugGrid.Rows.Count; i++)
            {
                bool blnFailed = false;

                // start at row 2
                if (i > 0)
                {
                    some code here and then...

                    if (CurrentFac > 1)
                    {
                        blnFailed = true;
                        lblMsg.Text = "Some Error Message 1.";
                        break;
                    }

                    if (PreviousFac> -1 && PreviousFac< 0 && CurrentFac< PreviousFac)
                    {
                        blnFailed = true;
                        lblMsg.Text = "Some Error Message 2.";
                        break;
                    }

                    if (NextFac > -1 && NextFac < 1 && CurrentFac > NextFac)
                    {
                        blnFailed = true;
                        lblMsg.Text = "Some Error Message 2.";
                        break;
                    }
                }
                if (blnFailed)
                {
                    blnReturn = false;
                }
            }
            return blnReturn;
        }

Any idea?  Is the break just halting the rest of the function2 or is it halting my entire app?
ASKER CERTIFIED SOLUTION
dba123

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros