title: How does a function with multiple return statements work?
body: <p>I am studying for MCSD certification. Given below is the sample code given in my book</p>
  
  <pre><code>private bool ValidateRow(TextBox descrTextBox, TextBox quantityTextBox,
          TextBox priceEachTextBox, out int quantity, out decimal priceEach)
  {
      // Assume these are 0.
      quantity = 0;
      priceEach = 0;
  
      // If no values are present, the row is okay.
      if ((descrTextBox.Text == "") &amp;&amp;
          (quantityTextBox.Text == "") &amp;&amp;
          (priceEachTextBox.Text == ""))
          return false;
  
      // Some values are present to make sure all are.
      if (ValidateRequiredTextBox(descrTextBox, "Description")) return true;
      if (ValidateRequiredTextBox(quantityTextBox, "Quantity")) return true;
      if (ValidateRequiredTextBox(priceEachTextBox, "Price Each")) return true;
  
      // All values are present.
      // Try to parse quantity.
      if (!int.TryParse(quantityTextBox.Text, out quantity))
      {
          // Complain.
          DisplayErrorMessage(
              "Invalid format. Quantity must be an integer.",
              "Invalid Format", quantityTextBox);
          return true;
      }
  </code></pre>
  
  <p>From the above you can see that there are many return statements. How do these return statements work? As you can see from above "ValidateRequiredTextBox" function is used thrice. </p>