Why does A_Index MsgBox start at 20 and not 1? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
rockitdontstopit
Posts: 70
Joined: 12 Nov 2022, 15:47

Why does A_Index MsgBox start at 20 and not 1?

Post by rockitdontstopit » 05 Jun 2023, 18:35

For the following code why does the MsgBox first appear with value 20 and not 1?

Code: Select all

Loop
{
    If (A_Index > 25)
    {
        Break
    }
    If (A_Index < 20)
    {
        Continue
    }
    MsgBox, 0, , a_index = %a_index%
}

User avatar
mikeyww
Posts: 26883
Joined: 09 Sep 2014, 18:38

Re: Why does A_Index MsgBox start at 20 and not 1?  Topic is solved

Post by mikeyww » 05 Jun 2023, 18:44

Explained here: Continue
Skips the rest of a loop statement's current iteration and begins a new one.

rockitdontstopit
Posts: 70
Joined: 12 Nov 2022, 15:47

Re: Why does A_Index MsgBox start at 20 and not 1?

Post by rockitdontstopit » 05 Jun 2023, 18:50

mikeyww wrote:
05 Jun 2023, 18:44
Explained here: Continue
Skips the rest of a loop statement's current iteration and begins a new one.
OH...didn't see the "Continue" even though it was right in front of my face. Thanks.

Post Reply

Return to “Ask for Help (v1)”