CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Error message not understood

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
eem2am



Joined: 18 Jul 2012
Posts: 21

View user's profile Send private message

Error message not understood
PostPosted: Wed Jul 18, 2012 12:48 pm     Reply with quote

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: 19559

View user's profile Send private message

PostPosted: Wed Jul 18, 2012 2:41 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jul 18, 2012 2:41 pm     Reply with quote

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);
}
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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