I'm trying to find a way to do a loop with a break label on Pulover Macro. I want to do something like this, which is AHK code format:
(from https://www.autohotkey.com/docs/commands/Break.htm)
Code: Select all
outer:
Loop 3
{
x := A_Index
Loop 3
{
if (x*A_Index = 6)
break outer ; Equivalent to break 2 or goto break_outer.
MsgBox %x%,%A_Index%
}
}
break_outer: ; For goto.
Things I've considered
I do not want to use goto because of the issues with it and exporting to AHK sometimes, and AHK discourages goto/gosub cause it's not as maintainable and readable.
I also don't want to use "break 2" because sometimes I have 7 loops nested in each other, and so I have to do break 7 which doesn't make the code very readable. Using a variable like break %LoopNumber% also doesn't work because it's not allowed by AHK.
Exporting it to AHK and then manually editing the code would make the AHK work, but then I cannot import it back to PMC to edit further.