"expression on global scope not allowed" error at compile time

 

About 1200 lines into my EA source, when compiling, I start to get multiple messages "blah..blah.. expression on global scope not allowed" on the

same global scope variable; using expressions like if( gbGlobal VAr ) that have passed compilation successfully in preceding function definitions.

This started to occur when I imported a user library in the program header... I saw a thread from 1/30/2006 by Michael Rennie on this same topic,

but have been unable to find the responses... Anyone got a fix? Suggestions as to how I have run amok?

 

Resolved this myself. A line of code similar to the following was to blame...

iVar = jVar; //*07312009 changed to use different var

The /* in the above comment was interpreted by the compiler as the beginning of a /* ... */ bracketed comments block. A later */ was picked up by the compiler, terminating the block, but the intervening code was ignored by the compiler. This anomaly was not visible in the MetaEditor (i.e the comment area that was

ignored was not changed in color), so it was not visible that this was what was going on in the MetaEditor.

Reason: