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

  • SEARCH
  • Home
  • 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 7656607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:48:35+00:00 2026-05-31T12:48:35+00:00

I have this logic in my analysis file. The user has the option to

  • 0

I have this logic in my analysis file.
The user has the option to choose a input file. if an error occurs or if the user has a invalid entry in the input file, then the logic checks and prints the error.

This method returns a bool success. Depending on if all the input is valid, successtakes T/F.
If success = T, then the next step analyzing the input starts.
Now here’s my question. How do i return a false`
;

if (xxx > 100)
{
    errMsg = "Number of xxx should be <= 100";
    swRpt.WriteLine(errTitle + errMsg);
}
// sizing
;
swRpt.WriteLine("   Epsilon");

//Repair
success = Numerical.Check("repair", inputs.repair.ToString(), 
                          out dtester, out errMsg);
if (!success)
{
    swRpt.WriteLine(errTitle + errMsg);
}
success = Numerical.Check("prob", inputs.prob.ToString(), 
                          out dtester, out errMsg);
if (!success)
{
    swRpt.WriteLine(errTitle + errMsg);
}

so now finally

if (success)
{
   //run the analysis method
}
if(!success)
{
   exit 
}

I need to exit if even one input is wrong. the first could be wrong and the last one could be a correct input value.

  • 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-31T12:48:37+00:00Added an answer on May 31, 2026 at 12:48 pm

    You can add another status flag that will be updated to false anytime there is a failure:

    bool status = true;
    if (xxx > 100)
    { 
        errMsg = "Number of xxx should be <= 100";
        swRpt.WriteLine(errTitle + errMsg);
        status = false;
    }
    // sizing
    
    swRpt.WriteLine("   Epsilon");
    
    //Repair
    success = Numerical.Check("repair", inputs.repair.ToString(), 
                              out dtester, out errMsg);
    if (!success)
    {
        swRpt.WriteLine(errTitle + errMsg);
        status = false;
    }
    success = Numerical.Check("prob", inputs.prob.ToString(), 
                              out dtester, out errMsg);
    if (!success)
    {
        swRpt.WriteLine(errTitle + errMsg);
        status = false;
    }
    
    return status;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this piece of logic I would like to implement as a trigger,
i have this code, and need help with the logic end. I would like
I have this code: using DC = MV6DataContext; using MV6; // Business Logic Layer
I have a problem with the logic of this code, XNA's Update Method is
I'm trying to figure out the logic of how to do this. I have
I have this table: User id INT PK login VARCHAR UNIQUE I want to
This is one of those scenarios where Paralysis by Analysis seems to have taken
I have to code this logic: UPDATE imported SET col1 = 'first' WHERE col2
I have this logic to print out the dates def get_y_axis dates = ed
I currently have this block: if ($type == up) { $lines_ = file('../indexIncomplete'); $counter

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.