decreasing for

  • Thread starter Thread starter Anibal David Acosta F.
  • Start date Start date
A

Anibal David Acosta F.

do you know how can I do something like this..

CurValue = 20; //or other value

for (int i=CurValue; i >=0; i--)
{
//do something here
}

when I compile an error occur and the "underline error mark" is below the
"i--"
the error is: "Unrecheable code detected (CS0162)"

Is possible to do a decreasing for in C# ?
 
Anibal said:
do you know how can I do something like this..

CurValue = 20; //or other value

for (int i=CurValue; i >=0; i--)
{
//do something here
}

when I compile an error occur and the "underline error mark" is below the
"i--"
the error is: "Unrecheable code detected (CS0162)"

Is possible to do a decreasing for in C# ?

That code (with an int before the declaration of CurValue) compiles fine for
me with no errors or warnings in both VS.NET 2003 and 2005.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top