Are you sure ? I added the space after ; (I have no spaces after the comment txt anywhere :hmm: ) and still showed errors. Will check again.
:hmm:
LegCourse = ( TgtBrg + 100 + rnd 40 mod 360 ) ; LW edit to 100 to 140
*** Unknown word or variable present ***
*** Unknown word or variable present ***
*** Unknown word or variable present ***
*** Unknown word or variable present ***
But moving whole comment to next line helped too

I usually use them this way (in separate line)