|
|
View previous topic :: View next topic |
Author |
Message |
eem2am
Joined: 18 Jul 2012 Posts: 21
|
Error message not understood |
Posted: Wed Jul 18, 2012 12:48 pm |
|
|
Hello
int8 ACDCflag=0;
int8 PHASEflag=0;
int8 FPMflag=0;
...CCS compiler is erroring the above, telling me its expecting a numerical expression.
I am declaring variables....so why do i need a numerical expression? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19553
|
|
Posted: Wed Jul 18, 2012 2:41 pm |
|
|
Difficult to know for sure, but the 'classic', would be that one of the names is also the name of a function somewhere else.
Other possibility though is that there is an error some lines _earlier_, which the compiler ploughs through, and keeps going till it gets here, and then complains. So something like a missing bracket on a function, so it still thinks these declarations are inside this.
Best Wishes |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Jul 18, 2012 2:41 pm |
|
|
There's nothing wrong with those lines. The problem is probably above
those lines somewhere.
Here's one example of how you might have done it. If you use an "="
sign in a #define statement, this will give the error, as shown in the
code below:
*** Error 51 "pcm_test.c" Line 17(10,11): A numeric expression must appear here
Quote: |
#include <16F877.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock=4M)
#use rs232(baud=9600, UART1, ERRORS)
#define MYVAL = 5 // Don't put an '=' sign in there. Remove it.
int8 ACDCflag=0;
int8 PHASEflag=0;
int8 FPMflag=0;
//====================
void main()
{
int8 a;
a = MYVAL;
while(1);
} |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|