Function Definition Unexpected Error

 

After changing the code in a function, and then compiling, I get a Function Definition Unexpexted Error for another function that I have not changed. The unchanged function is listed after the function that I changed. What would cause this compilation error?

 
forestmyopia wrote >>

After changing the code in a function, and then compiling, I get a Function Definition Unexpexted Error for another function that I have not changed. The unchanged function is listed after the function that I changed. What would cause this compilation error?

Nasty error, I find that usually it comes from a change in the location of ) or } and sometimes I have no idea. Really tough to track down since it doesn't generate

unbalanced brackets error. I usually go back and try to figure out what changed; not always easy to see the change in nested statements.

Good luck and if you find an easy way to debug this please let me know!!

Keith

 
kminler wrote >>

Nasty error, I find that usually it comes from a change in the location of ) or } and sometimes I have no idea. Really tough to track down since it doesn't generate

unbalanced brackets error. I usually go back and try to figure out what changed; not always easy to see the change in nested statements.

Good luck and if you find an easy way to debug this please let me know!!

Keith

Thanks for your input. So far I have found a cheap and dirty way around this. I just write my code in small chunks and then compile, write more code, then compile. I compile as I go. I have problems with this if I write a large section of code with many edits before compiling. Writing the code in small pieces seems to be the only way around this.

 
forestmyopia wrote >>

Thanks for your input. So far I have found a cheap and dirty way around this. I just write my code in small chunks and then compile, write more code, then compile. I compile as I go. I have problems with this if I write a large section of code with many edits before compiling. Writing the code in small pieces seems to be the only way around this.

That's not a cheap and dirty way... That's good practice in my humble opinion... I would go further than that and write small functional blocks and unit test them, then carry on writing. I've been writing/designing software for over 25 years and that's what I do all the time... There are people out there who write thousands of lines of source and then try and compile and debug it, but but I just can't work like that...

-=N=-

Reason: