PDA

View Full Version : Basic commenting question for Xcode




JBot
Mar 1, 2007, 05:15 PM
To comment a selected portion of your code, where do you go?
Very basic question, i know you can do it with other editors, i just dont know where that option is on Xcode.
Im writing in c++ if that matters.



slooksterPSV
Mar 1, 2007, 05:22 PM
To comment a selected portion of your code, where do you go?
Very basic question, i know you can do it with other editors, i just dont know where that option is on Xcode.
Im writing in c++ if that matters.

you can use the // for single lines and /* */ for multiple lines.
So if I had the code

#include <iostream>

int main()
{
//my program code goes here
std::cout << "Hello world";
/* I can have multiple paragraphs here
as well see */
return 0;
}

JBot
Mar 1, 2007, 05:25 PM
I know how to use that, but im wondering if there is a way for me to just highlight certain lines and go to the 'comment' button, and that will place the // infront of each individual line.
Emacs has that capability, i would hope Xcode does also...

lazydog
Mar 1, 2007, 05:28 PM
Under the Scripts menu (inbetween Window and Help) there are commands to comment and uncomment the current selection.

b e n

JBot
Mar 1, 2007, 05:31 PM
Under the Scripts menu (inbetween Window and Help) there are commands to comment and uncomment the current selection.

b e n

Thank you very much!