Page 1 of 1

(R44) Exiting Basic running program... woops, I pressed CTRL+V, but meant CTRL+C...

Posted: Sat Sep 09, 2023 7:03 am
by OldOzC64er
I am using the R44 emulator on Windows 10 (Git commit : C361BDE7)... Searched for this issue on forum, but couldn't see it. After submitting this issue, I have noticed how the "CTRL+V" paste (of information) is handled in the Basic/OS page in general, by attempting to process each line? I guess pressing "paste" (CTRL+V) during runtime is buffered/remembered by keypress process so when "exiting" with CTRL+C, it is then processed? Any CTRL+V keypress in buffer may need to be trapped/dropped at return to system, to avoid issues?

-------- The previous posted details of issue ---------------------------------------
Playing around with a Basic program that loads a data file and outputs information (data) to screen. I went to press CTRL+C to exit the current looping, but pressed CTRL+V.... and here it's a bit fuzzy, but then I think if you press CTRL+C to exit, it doesn't - and then it starts printing unusual "op codes" and data to screen with "?Syntax Error" then another, and another (many more than shows on my screen shot). I can't seem to exit this loop... but, my program loops through to the end I assume (which is how it's ending?).

After the errors finish, I think - Ok, I'll rerun the program, but it failed due to a 'new' Line 0 error. When I list the program - there are now lines 0,10,20,30,40,50,60,70,80,90 inserted which are ML op codes?

See below image - which shows the tail end of the output (to when it stopped). I then printed the Help command for the version info. I had earlier "reset" the emulator and loaded in my program before I noticed this issue.

The only link to the issue is perhaps "large PC copy buffer" issue?... as I have replicated the same result several times (3-4), but couldn't work out how to do so knowingly? Then, I just replicated it with a different large data source (in copy buffer of PC) and noticed, it isn't ML op code specific, but what is in memory of Copy. NOTE: I didn't realise I must have had a large amount of copied ML op codes that I was working on ealier still in PC copy buffer memory? This latest version of the error, which was just spewing my "data" numbers to screen for each Syntax Error line, did not add in to the program code lines afterwards. (So the ML lines may have been unique to the event for them to add in new lines of basic?).
CTRLVSyntaxErr.jpg
CTRLVSyntaxErr.jpg (64.25 KiB) Viewed 4034 times

Re: (R44) Exiting Basic running program... woops, I pressed CTRL+V, but meant CTRL+C...

Posted: Sun Sep 10, 2023 10:37 pm
by Ender
Doing Ctrl+V in the emulator pastes what's in your clipboard into the BASIC editor. This is meant to support copy/pasting BASIC programs from elsewhere (like a web page) into the emulator. It processes each line that's pasted like you typed it and pressed enter. If you have stuff in your clipboard that's not a BASIC program and do Ctrl+V, it will just give you a bunch of syntax errors, since it won't understand it.

Re: (R44) Exiting Basic running program... woops, I pressed CTRL+V, but meant CTRL+C...

Posted: Sun Sep 10, 2023 11:26 pm
by OldOzC64er
Yes. I understand that what's happening, after experimenting with the paste into Basic editor - and it's needed for sure. I am just suggesting the OS dev's may want to consider dropping any buffered "CTRL+V" keys (or anything in the keyboard buffer... if that's even possible) if CTRL+C is activated? The paste function is needed in a program sense as well, so it's only on exit (CTRL+C) that it shouldn't be passed back to the Editor? It can be replicated simply by having a large amount of information copied to memory, whilst program is running press - CTRL+V then CTRL+C... and you will have it all pasting to the Editor and either making new lines if suitable or SyntaxErrors and it doesn't stop.