Results 1 to 3 of 3

Thread: how to get the range from the arraylist

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    38

    how to get the range from the arraylist

    Hi...
    I am creating a arraylist..
    [apple, 02, car, orange, 03, bike, grape, 04, train]
    i wan to do a for..loop to get every 3 range of the object on the arraylist,
    example it will get (apple, 02, car) then(orange, 03, bike) then (grape, 04, train).
    I am doing the application for pocket pc..
    So, from the msdn website, i got to knw that i can use arraylist.getrange(index,count) but in my codes when i tried it states that getrange is not a member of arraylist.
    So, anyone can help, if there is any other way that i can do to get it working...
    thanxs 4 helping...

  2. #2
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: how to get the range from the arraylist

    this may help point you towards what you want
    VB Code:
    1. Dim newrange As String = ""
    2.         Dim l_ctr As Integer = 0
    3.         Dim l_e As IEnumerator = l_myarraylist.GetEnumerator()
    4.         l_e.reset()
    5.         While l_e.MoveNext
    6.             If l_ctr > 3 Then
    7.                'add code to do whatever is needed with the 3 elements
    8.                l_ctr = 0
    9.             End If
    10.             newrange &= Ctype(l_e.current,String) & ","
    11.             l_ctr = l_ctr + 1
    12.         End While
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    38

    Re: how to get the range from the arraylist

    ya..thanxs...ur codes helped me.....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width