View previous topic :: View next topic |
Author |
Message |
Guest
|
CCS example of WHILE |
Posted: Mon Feb 08, 2010 5:45 am |
|
|
I took this example from the help file, but it fails with " expecting a closed parenthesis"
is it me or CCS ?
while ( !input(PIN_B1) ); |
|
|
Ttelmah Guest
|
|
Posted: Mon Feb 08, 2010 7:12 am |
|
|
The fault is probably several lines earlier.
One problem with CCS, is that errors that are the result of things like bracket imbalance, only get reported, 'where' the compiler finally decides something is wrong, rather than where the initial counting error starts. So you can find an error like this reported on a line that is actually 'fine', being caused by soething may lines earlier.
The line as posted, compiles fine.
Best Wishes |
|
|
Guest
|
|
Posted: Mon Feb 08, 2010 7:49 am |
|
|
thanks for the quick reply.
If i comment the line out, it compiles fine. |
|
|
Ttelmah Guest
|
|
Posted: Mon Feb 08, 2010 8:02 am |
|
|
Is it possible you have an invalid definition for 'PIN_B1'?. This is just a numeric define and should be in the #include file for the processor. If it was defined wrongly, you could get this error.
What compiler version?.
Best Wishes |
|
|
Guest
|
|
Posted: Mon Feb 08, 2010 8:13 am |
|
|
its definitely not the pin assignment, i use it elsewhere.
it fails at the same point on V4.074, and V4.093
also tried it on another boot drive (same laptop computer though, just in case its a memory problem). |
|
|
Guest
|
|
Posted: Mon Feb 08, 2010 8:21 am |
|
|
found it !!!!
I was hacking some other code from a different compiler.
there was an assignment
#define INPUT 1
which of course totally threw the CCS parser
many thanks for you help though. |
|
|
|