[V2.beta.2] Loop Until do not support block Topic is solved

Report problems with documented functionality
User avatar
aseiot
Posts: 79
Joined: 05 Mar 2017, 04:25

[V2.beta.2] Loop Until do not support block

Post by aseiot » 17 Oct 2021, 05:47

Code: Select all

loop
{
	x := A_Index
	ToolTip(x)
}until A_Index = 100


MsgBox(x)

User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: [V2.beta.2] Loop Until do not support block

Post by TheArkive » 17 Oct 2021, 10:35

EDIT: My bad... budding out!
Last edited by TheArkive on 17 Oct 2021, 23:17, edited 1 time in total.

iseahound
Posts: 1434
Joined: 13 Aug 2016, 21:04
Contact:

Re: [V2.beta.2] Loop Until do not support block

Post by iseahound » 17 Oct 2021, 18:07

Definitely not working fine.

Code: Select all

      loop {
         if (A_Index > 5)
            throw Error("☹")

         str := "happy" . A_Index
      } until InStr(str, "happy2")
EDIT: I feel like I'm responsible for breaking loop-until even more
Last edited by iseahound on 17 Oct 2021, 21:16, edited 1 time in total.

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: [V2.beta.2] Loop Until do not support block

Post by swagfag » 17 Oct 2021, 18:27

it works fine if u havent yet updated to the commit that made it no longer work fine: https://github.com/Lexikos/AutoHotkey_L/commit/85202cab71352026704ffb787b2fa8ae5afcc03e (...probably)

User avatar
thqby
Posts: 396
Joined: 16 Apr 2021, 11:18
Contact:

Re: [V2.beta.2] Loop Until do not support block

Post by thqby » 17 Oct 2021, 22:16

I think line 5247 should be changed to if (aActionType == ACT_UNTIL && (!mPendingRelatedLine || mPendingRelatedLine->mActionType != ACT_LOOP))

lexikos
Posts: 9551
Joined: 30 Sep 2013, 04:07
Contact:

Re: [V2.beta.2] Loop Until do not support block  Topic is solved

Post by lexikos » 22 Oct 2021, 04:42

@thqby That would defeat the purpose of the check, by allowing Until to "relate to" more than one Loop. It also fails to take into account For..Until.

The fix for this bug must also take into account Loop-x-Until where x is any nested statement other than a block (as this is currently not working either).

I think 6380b3b does it.

Post Reply

Return to “Bug Reports”