is there a hot key to break an endless loop which is running
is there a hot key to break an endless loop which is running
OK I'm a bit rusty, haven't used qb seriously for about 10 years and I've just turned 80
My question is:- If, in programming in Windows XP and QB, if I inadvertently insert an endless loop into my code and run it before I find out that it is endless, what can I do to stop execution WITHOUT losing the program status wot I've got up till then?
My question is:- If, in programming in Windows XP and QB, if I inadvertently insert an endless loop into my code and run it before I find out that it is endless, what can I do to stop execution WITHOUT losing the program status wot I've got up till then?
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
Re: is there a hot key to break an endless loop which is run
Just use Ctrl + break to stop the program. Closing the window may close the QB IDE.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
Re: is there a hot key to break an endless loop which is run
OK, thanks a million, but, my keyboard (106 keys? seems a lot but i counted them twice)was made in china, has keys labelled in a sort of spanish shorthand.
CTRL I can find, but 'break' not.
CTRL I can find, but 'break' not.
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
Re: is there a hot key to break an endless loop which is run
LOL, my Dell keyboard doesn't either! Look for the Pause/Break button next to Scroll Lock.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
Re: is there a hot key to break an endless loop which is run
Bingo! I'm much indebted
ed
ed
Re: is there a hot key to break an endless loop which is run
This page doesn't give me the option to unsubscribe
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
Re: is there a hot key to break an endless loop which is run
Unsubscribe from what?
Uncheck Notify me when a reply is posted box if you don't want notifications.
Uncheck Notify me when a reply is posted box if you don't want notifications.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
Re: is there a hot key to break an endless loop which is run
One point I would like to append to this thread - is that if you are running QBASIC in DOSbox, the CTRL+Break does NOT work. However, there is a simple work-a-round. You can simply use CTRL+SCROLL LOCK - this performs the exact same function.
FYI
![Smile :)](./images/smilies/icon_smile.gif)
FYI
Re: is there a hot key to break an endless loop which is running
Hey, help another old guy out.. I'm with Gremlin4.... I've been in the trenches with COBOL, Assembler, FORTRAN etc.... and just a bit
of application programming with BASIC.... and I always (and probably always will) find that I have built me a cute little, tight, endless loop.
Most notable was going to top of page on a 1403 printer doing statements... ohhh, that was a fast printer... my question (beating a dead horse),
how can I get a QB64 program running under Win 10 to terminate... CTRL BREAK doesn't work, Control Scroll Lock doesn't work... (no such key on my Logitech K360 wireless keyboard).... however, the Windows famous "Nuclear Option" of terminating a running program works... a bit
of overkill.... was there updates on this subject?
Regards
Dennis/W6UHQ
Herald, CA
of application programming with BASIC.... and I always (and probably always will) find that I have built me a cute little, tight, endless loop.
Most notable was going to top of page on a 1403 printer doing statements... ohhh, that was a fast printer... my question (beating a dead horse),
how can I get a QB64 program running under Win 10 to terminate... CTRL BREAK doesn't work, Control Scroll Lock doesn't work... (no such key on my Logitech K360 wireless keyboard).... however, the Windows famous "Nuclear Option" of terminating a running program works... a bit
of overkill.... was there updates on this subject?
Regards
Dennis/W6UHQ
Herald, CA
-
- Coder
- Posts: 41
- Joined: Wed Oct 16, 2019 11:28 am
Re: is there a hot key to break an endless loop which is running
you could try CTRL+C but then its like CTRL+BREAK but you'd lose status.
In a Qbasic program you need to modify your endless loop from:
To:
but replace "X" with the actual key or scan code you want to use to force an exit out of your endless loop. I use "reset" and "system" instead of simply an "end" because "reset" closes all open files and "system" is a better way for me to end programs.
I know its not the most wonderful way to end a program but if your endless loop is rather complex, its a quick and dirty way to go
In a Qbasic program you need to modify your endless loop from:
Code: Select all
Do
**insert whatever
Loop
Code: Select all
Do
**insert whatever
if inkey$="X" then
reset
system
end if
**insert whatever
Loop
I know its not the most wonderful way to end a program but if your endless loop is rather complex, its a quick and dirty way to go