C51: USING #IF TO TEST CONDITIONS
Information in this article applies to:
In A51, I can do the following:
$if (CPU=1 OR DISP=3)
with 2 or more conditions. However, in C51 I could not find a way to do this. The following code:
#if CPU==1 OR DISP==2
gives me an error message. What's wrong?
The #if preprocessor directive in C expects C operators to be used.
Try using the logical or operator ('||') as shown in the following.
#if CPU==1 || DISP==2
That should work.
Refer to a good C manual for more information about how to use the #if preprocessor directive.
Last Reviewed: Tuesday, October 24, 2006
of your data.