View previous topic :: View next topic |
Author |
Message |
JAM2014
Joined: 24 Apr 2014 Posts: 138
|
Expecting Function Name error..... |
Posted: Tue May 15, 2018 12:09 pm |
|
|
Hi All,
I have a function (#2), that calls another function (#1) from within. When I try to compile the code, I get an error in function #2 where the #1 function is called. This error is: Expecting Function Name. Everything looks totally fine, and I can't see why it won't compile?
On a hunch I renamed function #1 from 'DOW' to '_DOW', and now the code compiles and works as expected. I seem to remember a similar fix from a while back when one of my function names started with a numerical character. Same fix, but apparently a different reason?
This works:
Code: | firstDOW = _DOW(year,month,targetDate);
|
This doesn't:
Code: | firstDOW = DOW(year,month,targetDate);
|
PCH v5.050
Any clues?
Jack |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
|
Posted: Tue May 15, 2018 12:31 pm |
|
|
off the top of my head... do you have function #1 coded before #2 ? I'm wondering if the compiler needs them that way as #2 has to call #1 and if #2 was written before #1, then the compiler would 'see' it ??
One of those chicken vs eggs deals.
I'm probably wrong as I'm not a C guy or compiler guru, just something I'm thinking while the rain comes down...
Jay |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19506
|
|
Posted: Tue May 15, 2018 12:51 pm |
|
|
Possibly you have something else called DOW already in the program. A variable etc.. |
|
|
JAM2014
Joined: 24 Apr 2014 Posts: 138
|
|
Posted: Tue May 15, 2018 1:06 pm |
|
|
Hi All,
Yes, Argh!!, a variable also called 'DOW' was the issue!
Thanks,
Jack |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19506
|
|
Posted: Tue May 15, 2018 1:43 pm |
|
|
The error was telling you exactly what was wrong, but it wasn't exactly expressing it in an 'obvious' way.... |
|
|
|