QB64 Phoenix Edition v3.5.0 Released!
#41
@kernelpanic I think I might have figured it out, it happens for me if I hold the F5 key a bit too long. If that's what's happening then I think the issue is that because I fixed the startup delay your program reaches the end basically immediately after starting. That by itself is perfectly fine, but if you're still holding the F5 key at that point then it will be picked up as input by the console and exit your program.

I would test and see if the issue still happens if you manually click the Run button, that would avoid the chance of sending any input to the console for your program. Also you could see if it still happens if you hit the F5 key as briefly as you can (though that might be hard. Maybe your computer is a bit faster then ours or something Big Grin).

Assuming that's the problem it might be worth us adding a workaround for it, we could have the IDE wait for you to release the F5 key before starting the program.
Reply
#42
(01-12-2023, 01:31 AM)DSMan195276 Wrote: @kernelpanic I think I might have figured it out, it happens for me if I hold the F5 key a bit too long. If that's what's happening then I think the issue is that because I fixed the startup delay your program reaches the end basically immediately after starting. That by itself is perfectly fine, but if you're still holding the F5 key at that point then it will be picked up as input by the console and exit your program.

I would test and see if the issue still happens if you manually click the Run button, that would avoid the chance of sending any input to the console for your program. Also you could see if it still happens if you hit the F5 key as briefly as you can (though that might be hard. Maybe your computer is a bit faster then ours or something Big Grin).

Assuming that's the problem it might be worth us adding a workaround for it, we could have the IDE wait for you to release the F5 key before starting the program.

Glitching from running too fast?  I guess that's always a possibility!

After the LOCATE, and before the END, add in these lines:

_DELAY 2
_KEYCLEAR

That'll make certain that you have time to get your hands off the F5 keys, before that END condition pops up wanting you to "Press any key to continue".  Wink
Reply
#43
It could happen on a computer with at least 16GB RAM and quad-core CPU, and the EXE file is small enough. Then it could be stored entirely in memory on first run, and fetched from there thereafter. Run from RAM-Disk but even faster. Some hard-core boys from MS-DOS could only dream about that...
Reply
#44
(01-12-2023, 01:31 AM)DSMan195276 Wrote: @kernelpanic I think I might have figured it out, it happens for me if I hold the F5 key a bit too long. If that's what's happening then I think the issue is that because I fixed the startup delay your program reaches the end basically immediately after starting. That by itself is perfectly fine, but if you're still holding the F5 key at that point then it will be picked up as input by the console and exit your program.

Yes, by holding the F5 key down a long time, I got multiple program executions too. Multiple but finite. Release the F5 key and soon enough they stop, in my case. Then you can exit each one. This also happens with version 3.4.1.

Same happened when I tried one of my own programs, if I keep the F5 key pushed down a long time. Momentarily pushing down the F5 key does not create this effect at all, in my case.

Using the mouse, to click on run and start, it seems to work flawlessly.

(Another way to avoid the problem is by clicking on the .exe file of the program.)
Reply
#45
Obviously then the keyboard focus remains on the QB64 IDE while the user program is launched. That's weird.

Some people aren't going to like a delay of any kind when the program launches but it's probably the best solution. Might want to enable "debug" mode to put in the delay, of 1/2-second or a bit less, right when the program is launched. But this is just me babbling.

Otherwise if this holding a key is a problem (*), cannot use the QB64 IDE, but a text editor to compose programs and a terminal to launch the compiler and run the created program. I almost forgot to add that there's the dialog that could be dismissed right after pressing [F5], how to get it back? (See screenshot below.) This is a good safeguard then for when a key gets stuck or when the user discovers he/she was holding it too long.

Click the mouse for "Run program" option in the IDE might produce the other problem LOL with poorly-written programs featuring "_MOUSEINPUT".

(*) It's possible with old keyboards and/or with material caught between/under the keys, as is the case with my 10-year-old laptop. A few times [F9] press causes Linux to go crazy, and so I have to try [CTRL][ALT][function-key] presses in turn to regain control.

[Image: f5-dialog-before-run.png]
Reply
#46
(01-12-2023, 04:13 AM)mnrvovrfc Wrote: Obviously then the keyboard focus remains on the QB64 IDE while the user program is launched. That's weird.

Some people aren't going to like a delay of any kind when the program launches but it's probably the best solution. Might want to enable "debug" mode to put in the delay, of 1/2-second or a bit less, right when the program is launched. But this is just me babbling.

Otherwise if this holding a key is a problem (*), cannot use the QB64 IDE, but a text editor to compose programs and a terminal to launch the compiler and run the created program. I almost forgot to add that there's the dialog that could be dismissed right after pressing [F5], how to get it back? This is a good safeguard then for when a key gets stuck or when the user discovers he/she was holding it too long.

Click the mouse for "Run program" option in the IDE might produce the other problem LOL with poorly-written programs featuring "_MOUSEINPUT".

(*) It's possible with old keyboards and/or with material caught between/under the keys, as is the case with my 10-year-old laptop. A few times [F9] press causes Linux to go crazy, and so I have to try [CTRL][ALT][function-key] presses in turn to regain control.

I've always thought that it's a good idea to clear the keyboard buffer when first starting a program.  You have no idea what the OS has sitting in it, just waiting for your program at start up.  Wink
Reply
#47
Dunno, guys. I've always thought, under most normal circumstances, barring an app specifically designed for it, that it's a really bad idea to keep any key pushed for a long time. Right? Even using Word or Excel, it's going to cause issues.
Reply
#48
Oh, something I noticed in version 3.5.0. The IDE no longer opens to the folder you last used, when opening a program. Now it seems to insist on putting you to the first folder you ever opened after installing QB64pe.

I kinda liked it better before. Of course, YMMV.
Reply
#49
Thumbs Up 
(01-12-2023, 01:31 AM)DSMan195276 Wrote: @kernelpanic I think I might have figured it out, it happens for me if I hold the F5 key a bit too long. If that's what's happening then I think the issue is that because I fixed the startup delay your program reaches the end basically immediately after starting. That by itself is perfectly fine, but if you're still holding the F5 key at that point then it will be picked up as input by the console and exit your program.

I would test and see if the issue still happens if you manually click the Run button, that would avoid the chance of sending any input to the console for your program. Also you could see if it still happens if you hit the F5 key as briefly as you can (though that might be hard. Maybe your computer is a bit faster then ours or something Big Grin).

Assuming that's the problem it might be worth us adding a workaround for it, we could have the IDE wait for you to release the F5 key before starting the program.

Bingo! It actually has to do with the amount of time it takes to press. Where duration . . . I do not sit down on the button, I just press it briefly, like I always do.
I have tried it now: the way I always press does not work, if I consciously just "tap" it then it works. This is the case with all programs, as I have now found.

Another problem solved! But it is strange, something must have gotten faster, because today I do not press the keys any slower than I did a month ago.

PS: Thanks for trying to resolve the issue. (I always forget it.)  Confused
Reply
#50
(01-12-2023, 03:03 PM)Kernelpanic Wrote:
(01-12-2023, 01:31 AM)DSMan195276 Wrote: @kernelpanic I think I might have figured it out, it happens for me if I hold the F5 key a bit too long. If that's what's happening then I think the issue is that because I fixed the startup delay your program reaches the end basically immediately after starting. That by itself is perfectly fine, but if you're still holding the F5 key at that point then it will be picked up as input by the console and exit your program.

I would test and see if the issue still happens if you manually click the Run button, that would avoid the chance of sending any input to the console for your program. Also you could see if it still happens if you hit the F5 key as briefly as you can (though that might be hard. Maybe your computer is a bit faster then ours or something Big Grin).

Assuming that's the problem it might be worth us adding a workaround for it, we could have the IDE wait for you to release the F5 key before starting the program.

Bingo! It actually has to do with the amount of time it takes to press. Where duration . . . I do not sit down on the button, I just press it briefly, like I always do.
I have tried it now: the way I always press does not work, if I consciously just "tap" it then it works. This is the case with all programs, as I have now found.

Another problem solved! But it is strange, something must have gotten faster, because today I do not press the keys any slower than I did a month ago.

From the release notes:  
  • #282#284 - The long start-up time for QB64-PE programs has been fixed, there should no longer be a delay before the QB64-PE code starts running - @mkilgore
Reply




Users browsing this thread: 33 Guest(s)