Code with if dont work

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
jkeks
Posts: 60
Joined: 20 Oct 2019, 00:24
Contact:

Code with if dont work

Post by jkeks » 20 Nov 2021, 10:37

Code: Select all

FileRead, cnt, counter.txt
...
For i in url {
    if ( A_Index < cnt ){
        msgbox % A_Index
        itemlist .= "Item " A_Index " is: " url[i] "`n"
    }
}
...
msgbox % itemlist
msgbox dont show

where is problem ?
why condition if ( A_Index < cnt ) is not working ?
maybe there are var type error ?

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

Re: Code with if dont work

Post by mikeyww » 20 Nov 2021, 10:46

After line 3, a single new MsgBox line that displays the value of cnt will tell you whether the loop runs and what the cnt value is.

Post Reply

Return to “Ask for Help (v1)”