T
Tom Kent
I'm running into a weird circumstance with Visual Studio 7.1, where it
will not properly indent a while loop nested inside a do-while loop. It
compiles and runs fine, but the automatic indenting messes it up every
time.
Here's an example:
using System;
namespace Do_While_Test
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
int counter1 = 0;
int counter2 = 0;
do
{
Console.WriteLine("Counter is: {0}", counter1);
Console.WriteLine("Counting down:");
counter2 = 4;
while(counter2 > 0)
{
--counter2;
Console.WriteLine("{0}", counter2);
}
++counter1;
}while(counter1 < 4);
}
}
}
Note the while in the middle is only indented to the same level as the
do and its { }'s...it should have gone to the level of the
Console.Writelines.
If your viewer messes up indenting, check out the file:
http://teeks99x.teeks99.com/test.cs
Tom
will not properly indent a while loop nested inside a do-while loop. It
compiles and runs fine, but the automatic indenting messes it up every
time.
Here's an example:
using System;
namespace Do_While_Test
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
int counter1 = 0;
int counter2 = 0;
do
{
Console.WriteLine("Counter is: {0}", counter1);
Console.WriteLine("Counting down:");
counter2 = 4;
while(counter2 > 0)
{
--counter2;
Console.WriteLine("{0}", counter2);
}
++counter1;
}while(counter1 < 4);
}
}
}
Note the while in the middle is only indented to the same level as the
do and its { }'s...it should have gone to the level of the
Console.Writelines.
If your viewer messes up indenting, check out the file:
http://teeks99x.teeks99.com/test.cs
Tom