Break an inner loop and continue an outer loop

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
toralf
Posts: 868
Joined: 27 Apr 2014, 21:08
Location: Germany

Break an inner loop and continue an outer loop

22 Apr 2015, 12:47

How could I break an inner loop and continue an outer loop (thus skipping the rest of the outer loop) in the same line/block as the break command for the inner loop?

The only way I can currently think of is using a var that I have to check after the inner loop and if true sets continue for the outer loop

Any other suggestions?
ciao
toralf
RHCP
Posts: 202
Joined: 30 Sep 2013, 10:59

Re: Break an inner loop and continue an outer loop

22 Apr 2015, 12:55

Like this?

Code: Select all

loop 
{
	msgbox % A_Index
	loop
	{
		continue, 2
		msgbox never going to be shown
	}
	msgbox never going to be shown
}
toralf
Posts: 868
Joined: 27 Apr 2014, 21:08
Location: Germany

Re: Break an inner loop and continue an outer loop

22 Apr 2015, 13:01

Thanks a lot. I thought I had to send first a break. I was mistaken.
ciao
toralf
User avatar
SL5
Posts: 879
Joined: 12 May 2015, 02:10
Contact:

Re: Break an inner loop and continue an outer loop

15 Oct 2018, 14:21

__ __https://autohotkey.com/docs/commands/Break.htm

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], RandomBoy and 184 guests