Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

My for loop isn't looping?

$
0
0
Sup autoit forums!

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!

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>