Classic Computer Magazine Archive COMPUTE! ISSUE 55 / DECEMBER 1984 / PAGE 10

Microsoft BASIC Variable Annihilation

When my program stops on an error, I edit the offending line, intending to CONTinue after I've made the change, but am amazed to find that changing a program line clears out all variables. I have to rerun the program and enter all the lost information every time I make a change. Why does this happen, and how can I get around the problem?

John H. Leonard

This problem, which is endemic to Microsoft BASIC (Atari BASIC preserves variables when you change a line) cannot be readily overcome. Variables are stored in memory immediately after the last line in your program. When editing or entering a line, the final program could become larger, and would overwrite some variables, turning them into an unseemly binary mush. BASIC could move the variables when a program changes size, but the designers of Microsoft BASIC decided to just clear all the variables.