Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Simple Question - Indenting
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
DrummaBoyFB




PostPosted: Fri May 14, 2010 11:21 pm   Post subject: Simple Question - Indenting

How do I indent my program using visual c++ 2010 express edition.
is there a button like in turing to indent you program ? please answer yes or no
and if the answer is yes please tell me how to do it, thanks.
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Fri May 14, 2010 11:32 pm   Post subject: RE:Simple Question - Indenting

There's a button on your keyboard, called 'tab'. Use it. Better to indent as you go than to do it all at once anyway.
chrisbrown




PostPosted: Sat May 15, 2010 9:26 am   Post subject: RE:Simple Question - Indenting

I don't use VS, but...

Quote:
Simply select the piece of code to be indented, press Ctrl+K and then press Ctrl+F and all the html or code will be nicely indented.

From here.

I don't see much learning value in counting out tab stops as long as you can appreciate the organization they provide.
TerranceN




PostPosted: Sat May 15, 2010 12:43 pm   Post subject: Re: RE:Simple Question - Indenting

methodoxx @ Sat May 15, 2010 9:26 am wrote:
I don't see much learning value in counting out tab stops as long as you can appreciate the organization they provide.


But it is a good habit to get into in case you need to use an editor that does not have auto-indentation (or when you just don't like how the auto-indentation works, like Turing, but of course it wont let you indent multiple lines at once, forcing you to waste a lot of time or use the auto-indentation, messing up the way you decided to space everything).
chrisbrown




PostPosted: Sat May 15, 2010 12:52 pm   Post subject: RE:Simple Question - Indenting

Oh absolutely, if the editor doesn't have that feature you should be doing it yourself, but it's silly to use a screwdriver when you have a power drill.
Tony




PostPosted: Sat May 15, 2010 1:24 pm   Post subject: Re: RE:Simple Question - Indenting

TerranceN @ Sat May 15, 2010 12:43 pm wrote:
like Turing, but of course it wont let you indent multiple lines at once

Turing's IDE might not, but other editors (TextMate in particular) do allow you to indent selected blocks of text left and right.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
TerranceN




PostPosted: Sat May 15, 2010 3:02 pm   Post subject: Re: RE:Simple Question - Indenting

Tony @ Sat May 15, 2010 1:24 pm wrote:
Turing's IDE might not, but other editors (TextMate in particular) do allow you to indent selected blocks of text left and right.


But Turing does not have a stand-alone compiler/interpreter (I forgot which Turing uses), meaning I would have to copy-paste every time I wanted to run something (just image large projects with multiple files... it would be such a mess). Also, I don't know of any text editors that have Turing syntax highlighting (although I know you can create custom languages in notepad++, so I might make one for Turing and post it).
mirhagk




PostPosted: Fri Jul 09, 2010 9:07 am   Post subject: RE:Simple Question - Indenting

Indentation always gets me, it's so much as I'm going, but when I go back and edit something, everything gets all screwed up. When I switched to visual C# 2008 I was like super happy, not only does it auto-indent everything as you work, it also has an amazing auto-complete word feature.

Both of these features are in visual studio C++ 2008 I think, but I don't know how to turn them on to do it automatically. (what good is an auto-complete word function if you have to use the toolbar to access it anyway....)
Sponsor
Sponsor
Sponsor
sponsor
andrew.




PostPosted: Fri Jul 09, 2010 9:52 am   Post subject: Re: RE:Simple Question - Indenting

TerranceN @ Sat May 15, 2010 3:02 pm wrote:
although I know you can create custom languages in notepad++, so I might make one for Turing and post it.
Please do
Zren




PostPosted: Fri Jul 09, 2010 10:13 am   Post subject: RE:Simple Question - Indenting

Learn Python, you'll program your brain to indent.

And I think Tony/Dan did a dump of the syntax somewhere(edit: couldn't find it :/)... but why would you use something other than the normal IDE?
mirhagk




PostPosted: Fri Jul 09, 2010 11:34 am   Post subject: RE:Simple Question - Indenting

Including in Turing in the help folder is a text document with every keyword
Quakerstate98




PostPosted: Thu Sep 02, 2010 8:23 pm   Post subject: Re: Simple Question - Indenting

If you mean indenting in terms on indenting your code for easier visiblity you can just highlight everything and hit tab on the keyboard. If you talking about indenting in output to like the console you can do as follows:

cout << "\tIm indenting my code" << endl;

just have to add \t inside the string and it will add a tab
andrew.




PostPosted: Thu Sep 02, 2010 9:35 pm   Post subject: RE:Simple Question - Indenting

In many programs and text editors, selecting text and then pressing tab will just replace the text with a tab instead of indenting it.
bbi5291




PostPosted: Thu Sep 02, 2010 11:32 pm   Post subject: Re: Simple Question - Indenting

This is true. I think Ctrl-Tab is the de facto standard keyboard shortcut for indentation by tabbing, if supported.
Quakerstate98




PostPosted: Fri Sep 03, 2010 1:07 am   Post subject: Re: Simple Question - Indenting

oh ya, the highlighting and tabbing only works in visual studio, well it may work in other compilers but i only know VS
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 15 Posts ]
Jump to:   


Style:  
Search: