PSOC Creator 3.3 code color meaning

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
RiLi_333781
Level 2
Level 2

When I use PSOC creator 3.3 build code, I got different color for code.

   

For example, after "if" and "else", one area all code are light color, another area code are dark color.

   

Can I assume the dark color code is real, the light is skipped?

   

Where I can find the color definition?

   

Thank you everyone help!

   

Richard Li

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Yes, with a #if the grayed-out code block will not be generated or compiled. On your post you were talking about "if" which is treated differently: even when you write

   

if(0) DoSomething(trivial);

   

the code will be seen by the compiler. Optimization will kick it out, but errors will be flagged. All that is not the case with a #if.

   

 

   

Bob

View solution in original post

0 Likes
6 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Welcome in the forum, Richard!

   

The code colours are adjustable. Macros, non executable code, comments, strings are coloured differently. Can you show us a (complete) example where you have a question for?

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
RiLi_333781
Level 2
Level 2

Hello Bob,

   

Thank you for fast responece as you always!

   

Attached one examples screen capture.

0 Likes
RiLi_333781
Level 2
Level 2

I use default PSOC Creator 3.3 setup.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Yes, with a #if the grayed-out code block will not be generated or compiled. On your post you were talking about "if" which is treated differently: even when you write

   

if(0) DoSomething(trivial);

   

the code will be seen by the compiler. Optimization will kick it out, but errors will be flagged. All that is not the case with a #if.

   

 

   

Bob

0 Likes

Thank you, Bob!

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You are always welcome, Richard.

   

 

   

Bob

0 Likes