problem solved, sort of. I'd made a load of mistakes in a function. even though the function was remmed out (remstart, remend), it still messed up compilation! possibly because of brackets.
Here's the offending function that caused all the trouble. Note that the lines the compiler claimed were at fault were way after this!
function _gen_replay_filename()
startstring$="p1("+special_weap$(oselect(3)))+")_vs_p2("+special_weap$(oselect(4))+"
sourcestring$=get time$()+"_"+get date$()
targetstring$=""
for s=1 to len(sourcestring$)
c$=mid$(sourcestring$,s)
if asc(c$)<=asc("9") and asc(c$)>=asc$(0)
targetstring$=targetstring$+c$
endif
if c$=":"
targetstring$=targetstring$+"_"
endif
next s
startstring$=startstring$+targetstring$
endfunction startstring$