Almost every line in the bas file causes an "invalid outside procedure" error. Below is an example:
START:
Open "COM1:9600,N,8,1,CS50000,DS50000,TB2048,RB2048" For Random As #1
MAIN:
Cls
Color 7, 9
'the first section of this program...