Menu:

Sponsor

Discover Master of Alchemy, our first iPad/iPhone and iPod touch game!

Follow Me

 

Forum's topics

Latest Files

Archives

Top Rated

Categories

Photo Gallery


Alessandro Crugnola on January 14, 2005 in SEPY

Comment, Comment Everywhere

Commenting lines, commenting multilines, uncommenting lines ect..
If you're a SE|PY user you probalby know that actually there are 2 different menu items for commenting/uncommenting code (and also 2 different key shortcuts).
I received different requests for change this thing. Some people ask me to make a unique shortcut/menu for commenting and uncommenting code, and also make 2 different way of add comment (one for '//' comment and the other for '/*' comment).
In this way, if you hit "comment" on a line:
_root.gotoAndStop(1);
it will become
// _root.gotoAndStop(1);

and, if you hit again on "comment" with the selection in the same line it will turn back to _root.gotoAndStop(1);
No problem in fact with single line selection.. but if you hit "comment" on a multiline selection like:
_root.gotoAndStop(1); //play();
another_line();
what should be the result?
1st solution:
Detect line by line, if line is commented then uncomment it, otherwise comment line //_root.gotoAndStop(1);
play
();
//another_line();
or 2nd solution Detect first line of the selection, if this line is commented, then try to uncomment all the lines in selection, otherwise comment every line of selection
//_root.gotoAndStop(1);
//play();
//another_line();

there is also a discussion in the developement mailing list, I'm not completely sure which is the best solution, even i prefer the second one.. I would like to know your opinion

 

Bookmark and Share

 

Tags: comments 

 



Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)


Type the characters you see in the picture above.





 

TrackBacks

TrackBack URL for this entry: http://www.sephiroth.it/cgi-bin/mt/mt-tb.cgi/90