Hi there,
I work on code with C# and I don’t find to understand behavior in one simple situation.
I want user to confirm moment when while loop should stop or be continued by entering yes or no. This part of the code (part2) works without part1, but does not work with part1 of the while loop. If user enters yes, he does not receive another prompt to select additional 2 objects, but being contently asked if he wants to continue. Given no as input loop exits without problem. Any explanation on what I am missing?
Code:
while(true)
{
//PART1
var go = new GetObject();
go.GetMultiple(2, 0);
Curve curveA = go.Object(0).Curve(), curveB = go.Object(1).Curve();
//Other code
// ...
//
//PART2
var response = new GetString();
response.SetCommandPrompt("Do you want to continue: y/n");
response.Get();
if (response.ToString() == "n")
break;
else if(response.ToString() == "y")
continue;
}