I have a scenario where I want to check the value of a cell in an application. When the value of the cell hits 0 or -1 I'd like the test to continue. So I have:
while (!cell.Value.Equals("0") || !cell.Value.Equals("-1"))
{
Console.WriteLine("Value ({1})",cell_value.Value);
Thread.Sleep(15000);
}
Unfortunately, when the cell reaches 0, it doesn't appear to 'break' out of the loop.
Output:
Value (20)
Value (13)
Value (10)
Value (9)
Value (4)
Value (1)
Value (0)
Value (0)
Value (0)
Value (0)
Is it best to try this with a while / do + while loop or is a for loop better?
Thanks,
J.
See Question&Answers more detail:os