I'm dealing with a probably common situation that I don't even know how to formulate in a search.
I decided to ask for guidance, not necessarily to get any piece of code but to ask about what is the best approach for this kind of situation.
I have a list named arrIntIndexesOfJobsThatWillBeKilled
containing the original indexes of the items that must be removed from another 5 lists.
However, when I remove an item from the other 5 lists, they are reindexed, and the indexes I once had in arrIntIndexesOfJobsThatWillBeKilled
are now invalid.
I want to remove only the items linked to the original indexes...
What is the best algorithm to handle this situation?
arrIntIndexesOfJobsThatWillBeKilled = arrIntIndexesOfJobsThatWillBeKilled.Distinct.ToList
If arrIntIndexesOfJobsThatWillBeKilled.Count > 0 Then
For Each Job As Integer In arrIntIndexesOfJobsThatWillBeKilled
arrStrJobDescription2.RemoveAt(Job)
arrStrPNDirectories2.RemoveAt(Job)
arrIntJobIDDirectories2.RemoveAt(Job)
arrStrSubDirectories2.RemoveAt(Job)
arrStrNCFile2.RemoveAt(Job)
Next
End If