473,662 Members | 2,631 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

While nesting in do-while

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.WriteLi ne("Counter is: {0}", counter1);
Console.WriteLi ne("Counting down:");
counter2 = 4;
while(counter2 > 0)
{
--counter2;
Console.WriteLi ne("{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.Writeli nes.

If your viewer messes up indenting, check out the file:
http://teeks99x.teeks99.com/test.cs

Tom

Nov 16 '05 #1
5 2318
Strange that... yet if you make them both
while () {}
loops it works fine.

"Tom Kent" <te*****@commun ity.nospam> wrote in message
news:Xn******** *************@2 07.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.WriteLi ne("Counter is: {0}", counter1);
Console.WriteLi ne("Counting down:");
counter2 = 4;
while(counter2 > 0)
{
--counter2;
Console.WriteLi ne("{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.Writeli nes.

If your viewer messes up indenting, check out the file:
http://teeks99x.teeks99.com/test.cs

Tom

Nov 16 '05 #2
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 misunderstandin g, 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
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
v-****@online.mic rosoft.com (Kevin Yu [MSFT]) wrote in
news:qt******** ******@cpmsftng xa10.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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
7137
by: Michael Hertz | last post by:
I have hundreds of samples of XML documents on my harddisc. But all of them lack the one or another feature of XML. Some XML documents have no attributes some others are rather flat (nesting level=2). Furthermore there are XML samples which do not have duplicate elements with only different attribute values or all with the same attributes. I would like to have an advanced XML document with nesting level 5-6, with 1-4 attributes of some of...
0
3109
by: Wolfgang Schwanke | last post by:
Dear usenet, I'm having the following small problem. I've been ask to add some Quicktime panoramas to a website. The author of the panoramas has made two versions of each: One in MOV format, which needs a Quicktime plugin, and one Java applet. He's also kindly supplied me with sample HTML code for each. The code looks like this (simplified):
8
3941
by: CoolPint | last post by:
I read in books that nested class cannot access private members of nesting class and vice versa unless they are made friends. Somehow, my compiler is letting my nested class member functions access private members of nesting class. template <typename T> class Container { // NO friendship given to any other public: class ContainerIterator;
8
2850
by: Hardrock | last post by:
I encountered some difficulty in implementing dynamic loop nesting. I.e. the number of nesting in a for(...) loop is determined at run time. For example void f(int n) { For(i=0; i<=K; i++) For(i=0; i<=K; i++)
4
2133
by: kl.vanw | last post by:
I would like to count the nesting level in template classes. How can I make the following work? #include <assert.h> template <class T> class A { public: A() { // what goes here?
12
2998
by: TristaSD | last post by:
Hi, Here's a nice footer I get inside every php page I write in wwwroot on my server. The code gets parsed just fine. I installed php5.2-win32 under W2K Server, IIS 5.0. I've installed php on XP machines before, no problems there. Fatal error: Nesting level too deep - recursive dependency? in Unknown on line 0 Cannot find module (IP-MIB): At line 0 in (none) Cannot find module
6
2640
by: stephen.cunliffe | last post by:
Hi, I'm looking for opinion/facts/arguments on the correct nesting of UL, OL, & LI elements. For example, this is what I want (unordered list): * Item 1 * Item 2 * Item 3
11
4959
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
Can switch statements be nested? I've got a large routine that runs off of a switch statement. If one of the switches in switch #1 is true, that enters switch statement #2. Some of the statements in switch #2 enter a 3rd switch. I don't receive any compile errors except whenever I attempt to add default switches to switches 2 or 3.
17
1903
by: henry | last post by:
Folks Here's a skeleton, generic HTML page, call it "index.php". You'll see a bit of php code in the middle: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head>
0
8345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8768
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8547
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7368
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5655
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2763
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1999
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1754
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.