The first part will return "21;22;23;25;26"
Code: Select all
kolx := 3
varx := "04-06-2018"
koly := 4
vary := "04-06-2018"
kolz := 5
varz := ""
loop read, % "n.csv"
{
if a_loopreadline = ""
continue
col := strSplit(a_loopreadline, ";", " `t" )
if (col[kolx] = varx) && (col[koly] = vary) && (col[kolz] != varz)
items .= A_index ";"
}
msgbox % items
items =
return
f1::
func(kolx,varx,koly,vary,kolz,varz)
msgbox % items
return
func(kolx,varx,koly,vary,kolz,varz)
{
global items
static col
loop read, % "n.csv"
{
if a_loopreadline = ""
continue
col := strSplit(a_loopreadline, ";", " `t" )
if (col[kolx] = varx) && (col[koly] = vary) && (col[kolz] != varz)
return items .= A_index ";"
}
}
What is it that i'm missing
Thanks to grimboto, I totally missed the return part, which is in the loop, thus exit the loop the first time round