I have some code that iterates through two multi-dimensional array objects and tries to find out when the first field (the name) matches. It doesn't work. The first item of each array is the same, and I've checked it with the debugger. If I put a breakdpoint at the IF statement and check the values of card[1] and CardList[1,1] (or CardList[1][1], I've tried both notations), they both say the exact same text: "Adept", but it never enters the IF statement.
Code: Select all
ImportTSV("AHData.txt", AHData) ; this just imports a tab delimited text file and builds the array. AHData is a 100x4 array and CardList is a 200x5 array
ImportTSV("Cards.txt", CardList)
Loop % Cardlist.MaxIndex() { ; tried using "for i, item in CardList" but it would not write new fields to "item"
i = A_Index
for k, card in AHData {
if (card[1] = CardList[i][1]) {
if secondPrice
CardList[i,6] = card[2]
}
}
}
As a secondary question, I originally had two for loops "for i, item in CardList" and "for k, card in AHData", and the comparison seemed to work, but the last line of the code would never do anything. It would get there, but it couldn't expand the array to add the 6th field?