Given this code
It would seem pretty hard to update the Main.proxyList List if one were using
as there's no way of knowing what `pos` might be. If I were to have a counter variable could I be sure that For Each was iterating from top to bottom? Is there an alternative or should I, in cases like this be doing
?
B4X:
For Each p As Proxy In Main.proxyList
If p.ip = p Then
p.efficacy = p.efficacy + 1
p.inuse = False
Exit
End If
Next
B4X:
Main.proxyList.Set(pos,p)
B4X:
For pos = 0 To Main.proxyList.Size -1
proxyRec = Main.proxyList.Get(pos)
If proxyRec.ip = ip Then
proxyRec.efficacy = proxyRec.efficacy + 1
proxyRec.inuse = False
Main.proxyList.Set(pos,proxyRec)
found = True
Exit
End If
Next