Shorted Arraylist with conditions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cmdolcet69

    #1

    Shorted Arraylist with conditions

    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?

  • Andrew Morton

    #2
    Re: Shorted Arraylist with conditions

    cmdolcet69 wrote:
    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<>oldVa lue Then
    myArrayList.Add (newValue)
    oldValue=newVal ue
    End If

    Andrew


    Comment

    Working...