Shorted Arraylist with conditions

  • Thread starter Thread starter cmdolcet69
  • Start date Start date
C

cmdolcet69

When working with an arraylist i need to put in some logic so that if
my A/D bit values are not moving it will remove them from the list and
move all other up that rank.

Example:

(0) 3940
(1) 3940
(2) 3938
(3) 3929
(4) 3902


In the arraylist is see that the A/D values dont move until it hit (2)
in the index, however i will need to have some way of determining that
movement.

the new arraylist should look like:
(0) 3940
(1) 3938
(2) 3929
(3) 3902

Would a for each loop do th job?
 
cmdolcet69 said:
When working with an arraylist i need to put in some logic so that if
my A/D bit values are not moving it will remove them from the list and
move all other up that rank.

Example:

(0) 3940
(1) 3940
(2) 3938
(3) 3929
(4) 3902


In the arraylist is see that the A/D values dont move until it hit (2)
in the index, however i will need to have some way of determining that
movement.

How about not adding a new value if it is the same as the previous value?

If newValue<>oldValue Then
myArrayList.Add(newValue)
oldValue=newValue
End If

Andrew
 
Back
Top