[v2-beta.1] Until statements run forever after an if statement without braces Topic is solved

Report problems with documented functionality
iseahound
Posts: 1434
Joined: 13 Aug 2016, 21:04
Contact:

[v2-beta.1] Until statements run forever after an if statement without braces

Post by iseahound » 25 Sep 2021, 21:04

If braces are omitted around a {loop ... until} construction, the until statement will run in an infinite loop despite the body of the loop statement having already exited.

Code: Select all

if true
  loop
    MsgBox i := A_Index
  until i > 3

msgBox "finished"
004: Until i > 3
004: Until i > 3
004: Until i > 3
004: Until i > 3
004: Until i > 3
004: Until i > 3
004: Until i > 3
004: Until i > 3
004: Until i > 3
004: Until i > 3
004: Until i > 3
004: Until i > 3 (0.02)


Post Reply

Return to “Bug Reports”