By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,694 Members | 1,270 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,694 IT Pros & Developers. It's quick & easy.

While nesting in do-while

P: n/a
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

Nov 16 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Strange that... yet if you make them both
while () {}
loops it works fine.

"Tom Kent" <te*****@community.nospam> wrote in message
news:Xn*********************@207.46.248.16...
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

Nov 16 '05 #2

P: n/a
Hi Tom,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that the while block is indenting
incorrectly in VS.NET text editor. If there is any misunderstanding, please
feel free to let me know.

I have tried it on my machine and successfully reproed it. Currently, I'm
contacting the corresponding team on this issue and will update you as soon
as they give me any feedback.

Thanks for your patience!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #3

P: n/a
Hi Tom,

I have confirmed this as a known issue in VS.NET 2003. It will be fixed in
the next version of VS.NET. Thank you very much for your feedback!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #4

P: n/a
v-****@online.microsoft.com (Kevin Yu [MSFT]) wrote in
news:qt**************@cpmsftngxa10.phx.gbl:
Hi Tom,

I have confirmed this as a known issue in VS.NET 2003. It will be
fixed in the next version of VS.NET. Thank you very much for your
feedback!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


There aren't any bug fixes or anything for VS.NET 2003? Is there going to
be some way to get this bug fixed without buying a new copy?!?
Tom
Nov 16 '05 #5

P: n/a
Hi Tom,

To get a hotfix, I think this can be done quickly and effectively with
direct assistance from a Microsoft Support Professional through Microsoft
Product Support Services. You can contact Microsoft Product Support
directly to discuss additional support options you may have available, by
contacting us at 1-(800)936-5800 or by choosing one of the options listed
at http://support.microsoft.com/default...d=sz;en-us;top. If this is
a bug, they will help you free of charge.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.