REM Use are you own risk REM REM REM REM dim a$(5000) dim l$(300) dim li$(300) defint a-z open "tmp.bas" for input as 1 p=0 l=0 while not eof(1) p=p+1 input #1,aa$ a$(p)=aa$ wend close 1 for i = 1 to p if left$(ltrim$(a$(i)),1) = "'" then j=instr(1,a$(i),"'") if j=1 and len(a$(i)) = 1 then a$(i)="REM" elseif j=1 then a$(i)="REM "+mid$(a$(i),2) else a$(i)=left$(a$(i),j-1)+"REM "+mid$(a$(i),j+1) end if end if next REM if line ends with : assumed to be a label for i = 1 to p if rtrim$(mid$(a$(i),len(a$(i)),1))=":" then l=l+1 l$(l) = left$(a$(i),instr(1,a$(i),":")-1) li$(l) = ltrim$(str$(i)) a$(i) = ltrim$(str$(i)) end if next for i = 1 to p if instr(1,ucase$(a$(i)),"GOTO ") <> 0 or instr(1,ucase$(a$(i)),"GOSUB ") then for j = 1 to l ll = instr(1,a$(i),l$(j)) if ll <> 0 then a$(i)=left$(a$(i),ll-1)+li$(j)+mid$(a$(i),ll+len(l$(j))) end if next end if next for i = 1 to p if instr(1,ucase$(a$(i)),"LINE INPUT") <> 0 then o=instr(1,ucase$(a$(i)),"LINE INPUT") a$(i)=left$(a$(i),o-1)+mid$(a$(i),o+5) end if next open "tmp.bas" for output as 1 for i = 1 to p print #1,a$(i) next close