473,379 Members | 1,260 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Dealing with curly braces ;}

Hello all..

In the VS.Net IDE, is there a way to auto-format your code (such that
the curly braces for code blocks automatically align, code is
automatically indented to proper levels etc)? If not in 2003, will this
feature be available in 2005?

It sux to deal with so much variation in code formatting style between
different programmers. At least VB.net makes formatting consistent by
default. I promise to stop complaining if you will tell me how to do
this in C# :)

Nov 16 '05 #1
4 3659
select all code in the window (ctrl-a)

then
ctrl-k ctrl-f

Also in the menu under Edit->Advanced->Format Selection

Formats all selected code in window.

I know your pain. ;)

jim

"JavaGeekRoyR" <de*******@hotmail.com> wrote in message
news:10*********************@f14g2000cwb.googlegro ups.com...
Hello all..

In the VS.Net IDE, is there a way to auto-format your code (such that
the curly braces for code blocks automatically align, code is
automatically indented to proper levels etc)? If not in 2003, will this
feature be available in 2005?

It sux to deal with so much variation in code formatting style between
different programmers. At least VB.net makes formatting consistent by
default. I promise to stop complaining if you will tell me how to do
this in C# :)

Nov 16 '05 #2
JavaGeekRoyR,

There is no support for this in VS.NET 2003, but in VS.NET 2005, there
is a huge amount of support for formatting. You can find it under "Tools |
Options"

Then in the dialog that shows up, go to "Text Editor | C# | Formatting"
and you can see a number of options relating to the formatting that the IDE
applies to your code.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"JavaGeekRoyR" <de*******@hotmail.com> wrote in message
news:10*********************@f14g2000cwb.googlegro ups.com...
Hello all..

In the VS.Net IDE, is there a way to auto-format your code (such that
the curly braces for code blocks automatically align, code is
automatically indented to proper levels etc)? If not in 2003, will this
feature be available in 2005?

It sux to deal with so much variation in code formatting style between
different programmers. At least VB.net makes formatting consistent by
default. I promise to stop complaining if you will tell me how to do
this in C# :)

Nov 16 '05 #3
Thanks!

Nov 16 '05 #4
what am i missing here ?
in vs.net 2003 ( and afaik all previous versions ) typing a closing brace
formats all code back to the matching opening brace.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2****************@TK2MSFTNGP10.phx.gbl...
JavaGeekRoyR,

There is no support for this in VS.NET 2003, but in VS.NET 2005, there
is a huge amount of support for formatting. You can find it under "Tools | Options"

Then in the dialog that shows up, go to "Text Editor | C# | Formatting" and you can see a number of options relating to the formatting that the IDE applies to your code.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"JavaGeekRoyR" <de*******@hotmail.com> wrote in message
news:10*********************@f14g2000cwb.googlegro ups.com...
Hello all..

In the VS.Net IDE, is there a way to auto-format your code (such that
the curly braces for code blocks automatically align, code is
automatically indented to proper levels etc)? If not in 2003, will this
feature be available in 2005?

It sux to deal with so much variation in code formatting style between
different programmers. At least VB.net makes formatting consistent by
default. I promise to stop complaining if you will tell me how to do
this in C# :)


Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: deko | last post by:
Do I need to use curly brackets in PHP if .. else statements? other constructs? Does it matter? What are Best Practices? Why? thanks in advance... This seems to work WITHOUT curly brackets:...
8
by: Ken in Melbourne Australia | last post by:
If I use the curly bracket syntax (referred to as the complex syntax) within a string, how do I get to call a function within it? The php manual says that the first (or previous) character for...
0
by: Dustin D. | last post by:
Let's say I have a text file with the following: food { fruits { apples oranges pears } dairy { ice_cream {
6
by: STF | last post by:
While reading the C++ tutorial in this page: http://www.cplusplus.com/doc/tutorial/tut2-2.html I'm astonished to learn that we could omit curly brackets in function declaration for single...
0
by: JavaGeekRoyR | last post by:
Hello all.. In the VS.Net IDE, is there a way to auto-format your code (such that the curly braces for code blocks automatically align, code is automatically indented to proper levels etc)? If...
5
by: krbyxtrm | last post by:
Hi is there a way to 'manage' function execution using macros? #define MY_CALL_MACRO(MacroName) { g_MacroStack.push_back(MacroName); <some code here...>} such that when i use the...
5
by: TJ | last post by:
I'd like to know how the preprocessor treats curly braces, as compared to how it treats parentheses. What happens if I pass this: { a_function( arg1, arg2, arg3 ) } as an argument to a...
3
by: Grande News | last post by:
Hi, I've got some PHP code that looks like this $cura= ord($data{$pnum*2}); $curb = ord($data{$pnum*2+1}); Notice the curly braces -- does using them make any difference, or will square...
2
by: mauricioarango | last post by:
Hi everybody, I'm a PHP beginner, so please forgive me for this question. I am working on code someone else wrote a long time ago. The code was written without curly braces in many places, which...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.