google/wwwbasic

A suggested bug-fix for the "swap" statement

CharlieJV opened this issue · 1 comments

As is, "swap a$, b$" will put the value of b$ in a$, then put a$ (which is now equal to b$) into b$ (i.e. leaving b$ as it was at the start.)

The fix to my version of the code (included in BASIC Anywhere Machine, new release pending) has this line:

curop += b + ' = t' + ';\n';

which replaces the following line in the version of wwwbasic.js currently on github:

curop += b + ' = ' + a + ';\n';

Thanks for catching!
I've fixed here and added a test:
4b17610