if contains problem code example included
Posted: 20 Jul 2018, 18:31
See in my code here, I just want to check if the line contains a word, but it does not work
Code: Select all
dummytext =
(
first line
second line
third line
forth line
)
Loop, parse, dummytext, `n, `r
{
if (A_LoopField contains "second") ; if I change this to: if (A_LoopField = "second line") everything works
{
continue
}
tlines%A_Index% := A_LoopField
thevars .= "tlines" A_Index " = " tlines%A_Index% "`n"
tht = %a_index%
}
MsgBox, %thevars% `n total loops %tht%
ExitApp