Why is an execution result strange?

Pay attention to spelling of the names of variables.

Mistake on spelling of names of variables yields no error when the program is compiled.

Use STEP by STEP execution to do debug.

When you click to launch the program, the debug window shall appear.
The debug window displays all variavles, so you can confirm there are no variable you did not use.

Does the program contain any reserved word of Microsoft BASIC?

Many of built-in function with no argument such as INKEY$, CSRLIN, ERL, ERR are considered as simple variables.
The initial values of those variables are zero or empty string.
Example.
LET S$=INKEY$
substitutes empty string for s$.


Back