Loop with break label

Advanced Macro Recorder/Editor.

Moderator: Pulover

CreativiTimothy
Posts: 2
Joined: 29 Jul 2016, 03:34

Loop with break label

02 Apr 2022, 14:40

Hi,

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.
I cannot find a way to do this in Pulover Macro. I tried to put in the "LoopLabel" box "outer" and "break_outer", but it doesn't work. PMC treats it as a regular break (1 loop), so it continues to loop indefinitely. When I open the


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.

Return to “Pulovers Macro Creator”

Who is online

Users browsing this forum: No registered users and 18 guests