Author |
Message |
DrummaBoyFB
|
Posted: 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. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Insectoid
![](http://compsci.ca/v3/uploads/user_avatars/13760332514cbd0ce972eaa.jpg)
|
Posted: 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. |
|
|
|
|
![](images/spacer.gif) |
chrisbrown
![](http://compsci.ca/v3/uploads/user_avatars/18814724584bcbb8192aae8.png)
|
Posted: 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. |
|
|
|
|
![](images/spacer.gif) |
TerranceN
|
Posted: 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). |
|
|
|
|
![](images/spacer.gif) |
chrisbrown
![](http://compsci.ca/v3/uploads/user_avatars/18814724584bcbb8192aae8.png)
|
Posted: 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. |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: 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. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
TerranceN
|
Posted: 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). |
|
|
|
|
![](images/spacer.gif) |
mirhagk
|
Posted: 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....) |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
andrew.
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
Zren
![](http://compsci.ca/v3/uploads/user_avatars/1110053965512db6185954b.png)
|
Posted: 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? |
|
|
|
|
![](images/spacer.gif) |
mirhagk
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
Quakerstate98
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
andrew.
|
Posted: 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. |
|
|
|
|
![](images/spacer.gif) |
bbi5291
|
Posted: 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. |
|
|
|
|
![](images/spacer.gif) |
Quakerstate98
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
|