Author |
Topic |
|
martin
New Member
Germany
2 Posts |
Posted - Sep 25 2009 : 10:21:58 AM
|
Hey, I've a lot of #ifdef/#else/#endif statements in my code and would like to have inactive code colored normally but with a different background color. Something like http://www.xcomserver.de/VAXsugg.JPG |
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Sep 25 2009 : 10:50:13 AM
|
Depending on the IDE you are using, something like this may already exist. Look for the option:
IDE tools menu -> Options -> Text Editor -> C/C++ -> Formatting -> Colorize inactive code blocks in a different color
|
zen is the art of being at one with the two'ness |
|
|
martin
New Member
Germany
2 Posts |
Posted - Sep 25 2009 : 10:56:11 AM
|
Well, it's just a check box which disables graying out inactive code. But then I have no more hints which code is active or inactive. It would be nice if nothing but the background color would change for inactive code. |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Sep 25 2009 : 11:21:31 AM
|
If this checkbox / feature is turned on then the IDE makes the inactive code grey, which is quite obvious, so you can see at a glance which code the IDE thinks is inactive.
Are you saying this never turns code grey for you? What about:
#if 0 // some code #endif
|
zen is the art of being at one with the two'ness |
|
|
sean
Whole Tomato Software
USA
2817 Posts |
Posted - Sep 25 2009 : 11:31:29 AM
|
He wants normal VA symbol coloring with a special background color. |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Oct 01 2009 : 08:55:06 AM
|
martin how are you marking your inactive code? Is it simply wrapped in #if 0, #endif, or does it require a more complex method to work out if it is inactive?
In general VA is unable to work out if a given block of code is active or inactive, since it depends on so many things. Is the code being compiled in debug or release mode? Other environment variables, project settings, etc. |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|