Results 1 to 4 of 4

Thread: array

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 1999
    Location
    tehran,iran
    Posts
    53

    Post

    i want to use array , but i do not know the
    range of array at design time , it depend on
    how users use that program . what is the way of this problem , how can define a unlimited array .is it possible ?


  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Post

    You can ReDim your arrays during run-time.

    Private iMyArr() As Integer

    Private Sub Form_Load()
    ReDim iMyArr(100)
    'or to preserve the array values:
    ReDim Preserve iMyArr(200)
    End Sub

    Good luck!

    ------------------
    Joacim Andersson
    joacim@programmer.net
    joacim@yellowblazer.com
    www.YellowBlazer.com



  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,175

    Post

    You can also use a collection instead of an array. You just add items to the collection as you need to and you don't have to redim.

    ------------------
    Marty

  4. #4
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    Marty is right, Collection items can be just removes using Remove method. But array are much faster. So, if you're going for the speed, use Array, if you're going for flexebility, use Collections

    ------------------

    Serge

    Software Developer
    Serge_Dymkov@vertexinc.com
    Access8484@aol.com
    ICQ#: 51055819


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