Sup autoit forums!
I'm trying to make a loop to search values from an array into another array
Can you guys spot my mistake? I can't see it. It should work.
Thanks!
I'm trying to make a loop to search values from an array into another array
[ autoit ]
#include <file.au3> #include <array.au3> Dim $ArrayAllSources _FileReadToArray("allsources.csv", $ArrayAllSources) Dim $ArrayList _FileReadToArray("list.txt", $ArrayList) _ArrayDisplay($ArrayAllSources) ; array of about 1000 items, [0] contains the total amount of item _ArrayDisplay($ArrayList) ; array of about 10 items, [0] contains the total items For $i = 1 to $ArrayList[0] ; from 1 to 10, should loop 10 times $ItemToSearch= $ArrayList[$i] ConsoleWrite($ItemToSearch & @CRLF) ; correctly returns the item at line number For $i = 1 to $ArrayAllSources[0] $pos = StringInStr($ArrayAllSources[$i], $ItemToSearch ) if $pos > 0 then ConsoleWrite($pos & @CRLF) ; corretly returns the line number where the first item was found Else EndIf Next ; but then it never loops, just exits there! Next
Can you guys spot my mistake? I can't see it. It should work.
Thanks!