Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 changing /**/ comments to //
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

.dan.g.
New Member

5 Posts

Posted - Jul 24 2005 :  9:06:55 PM  Show Profile
hi all

does anyone have an easy way to convert C styles comments to C++? i want to be able to comment out large blocks of someone else's code but they've used C style comments throughout which makes it painful. and there are alot of files that need such work. needs to work with single and multiline comments

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Jul 25 2005 :  06:23:52 AM  Show Profile
If they've used C-style comments, you can comment the section out with C++-style comments. Or with #if 0.

Stephen Turner
ClickTracks http://www.clicktracks.com/
Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Jul 25 2005 :  3:19:50 PM  Show Profile
one fast and slightly nasty solution would be:

CTRL_A followed by /

to get VAX to turn every line in the fine into C++ single line comments.

personally i would just use #if 0 as Stephen suggests. if you are doing this it is worth using:

#if 0 //{{AFX_COMMENTED_OUT
#endif //}}AFX_COMMENTED_OUT

instead, since you can then tell the IDE to colour the code inside the #if 0 a specific colour, making it much easier to see what you are doing.

zen is the art of being at one with the two'ness
Go to Top of Page

.dan.g.
New Member

5 Posts

Posted - Jul 25 2005 :  8:10:58 PM  Show Profile
thanks guys.

feline: can you tell me how to get the IDE to color '#if 0' differently?

.dan.g.

www.abstractspoon.com
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Jul 26 2005 :  3:25:47 PM  Show Profile
presuming you mean the text between:

#if 0 //{{AFX_COMMENTED_OUT
#endif //}}AFX_COMMENTED_OUT

in the IDE's options change the colour for the group "Wizard code". this is hidden under the format tab in VC6 options which i recall you tend to use

if you are doing this a lot then it is worth setting up a couple of autotext entries, i have:

#if:
#if 0   //{{AFX_COMMENTED_OUT-?
#en:
#endif  //}}AFX_COMMENTED_OUT-?


changing tack excellent work on the latest todo list beta i will get back to you on that one at codeproject one of these days, honest, just as soon as i get caught up

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000