Basic if endif not working and I'm puzzled
You can't use commands like receivers++ outside of a function.  That is runtime executable code, and has to be run from inside a function. Global scope doesn't get executed in the same way as code in a function.