Home > Net >  Why don't insert breakpoints in the if statement
Why don't insert breakpoints in the if statement

Time:10-10

I have chosen an option, or can't get into breakpoints, and also could not judge right and wrong

CodePudding user response:

Code paste in words, do not use images, and I couldn't mark any copy mark,,
Which one IF you don't take effect, in the code posted on,
Then tell me, how much is the value of two parameters, respectively, what do you think, and are probably explain,
Into effect in general, IF not, is not equivalent on both sides, you are in the IF the location of the breakpoint, then the IF ("//"this content), copied to quickly check in the monitor, what one is not the same, the length of the string, IF is the string

CodePudding user response:

reference 1st floor tian-xing zhang response: ,
, code words paste, do not use images, and I couldn't mark any copy mark,,
Which one IF you don't take effect, in the code posted on,
Then tell me, how much is the value of two parameters, respectively, what do you think, and are probably explain,
Into effect in general, IF not, is not equivalent on both sides, you are in the IF the location of the breakpoint, then the IF ("//"this content), copied to quickly check in the monitor, what one is not the same, the length of the string, IF the string
public bool getResult ()
{
Bool b=false;
int i=0;

Foreach (ListItem li in this. RadioButtonList1. Items)
{
String s="" + (char) (65 + I);

If (li. Selected)
{
If (s==ps. Answer)
{
Enclosing Label1. Text="");
return true;

}
The else
{
This. Label1. Text="x";
return false;
}

}
i++;
}
This. Label1. Text="x";
Return b;

}

CodePudding user response:

reference 1st floor tian-xing zhang response: ,
, code words paste, do not use images, and I couldn't mark any copy mark,,
Which one IF you don't take effect, in the code posted on,
Then tell me, how much is the value of two parameters, respectively, what do you think, and are probably explain,
Into effect in general, IF not, is not equivalent on both sides, you are in the IF the location of the breakpoint, then the IF ("//"this content), copied to quickly check in the monitor, what one is not the same, the length of the string, IF the string
IF (li. Selected) into don't go, then I put (li. Selected) roles and retype it just can go in, every time so the operation, I remember just typed code is that it

CodePudding user response:

I feel not you rewrite the if (li. Selected) problem, but you to run the code, the code run successfully for the first time, after running for the first time in the problem in your method does not perform, suggest you call this method before and after, before the if, after add breakpoints, and then run it, and see where is no execution, it's easy to find the reason

CodePudding user response:

To regenerate, switch off the VS to restart
  • Related