First of all, thank you very much for creating and maintaining this wonderful project! I enjoyed programming in GW-BASIC when I was young and now PC-BASIC is providing me the same experience on my Windows PC with just one click on the nice "Ok" icon.
I was learning and testing ON KEY / ON TIMER statement, and I believe I found a bug in ON TIMER(n) stetement implementation. Below is the code I was experimenting with:
10CLS15PRINT"Press UP arrow key to exit...20ONKEY(11)GOSUB8030KEY(11)ON32ONTIMER(1)GOSUB10034TIMERON40FORI=1TO1050PRINT"Hello, World!60NEXTI70GOTO7080KEY(11)OFF:PRINT"Removing KEY(11) trap setting...90END100PRINT"Hello, every one second!110RETURN70'gotoinfiniteloop
I was expecting "Hello, World!" to be printed first 10 times, followed by "Hello, every one second!" later every one second, however, "Hello, World!" never gets printed at all. "Hello, every one second!" gets printed immediately after TIMER ON statement. BTW, print statement without the terminating double quote was written intentionally in such style after learning that LOAD/SAVE/CHDIR statement works fine like.
Thanks,
Francis
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I also found that KEY(11) OFF is not required in GW-BASIC 3.23 (with dosbox) when the program is terminiated, however without this statement, the UP arrow key is not responding anymore in PC-BASIC.
Thanks,
Francis
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Rob,
First of all, thank you very much for creating and maintaining this wonderful project! I enjoyed programming in GW-BASIC when I was young and now PC-BASIC is providing me the same experience on my Windows PC with just one click on the nice "Ok" icon.
I was learning and testing ON KEY / ON TIMER statement, and I believe I found a bug in ON TIMER(n) stetement implementation. Below is the code I was experimenting with:
I was expecting "Hello, World!" to be printed first 10 times, followed by "Hello, every one second!" later every one second, however, "Hello, World!" never gets printed at all. "Hello, every one second!" gets printed immediately after TIMER ON statement. BTW, print statement without the terminating double quote was written intentionally in such style after learning that LOAD/SAVE/CHDIR statement works fine like.
Thanks,
Francis
Hi Rob,
I also found that KEY(11) OFF is not required in GW-BASIC 3.23 (with dosbox) when the program is terminiated, however without this statement, the UP arrow key is not responding anymore in PC-BASIC.
Thanks,
Francis
Hi Francis,
Thanks for reporting this - I'll have a look.
Rob
Bug tracker here https://github.com/robhagemans/pcbasic/issues/25