Results 1 to 3 of 3

Thread: Is there anyway

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2001
    Location
    Canada
    Posts
    40

    Is there anyway

    to make an unlimited array?

    you usually declare it as:

    Code:
    dim poo(100) as string
    is there anyway to make the array never ending?

  2. #2
    jim mcnamara
    Guest
    Dynamic arrays allow you redimension them until you run out of memory

    Code:
    dim arr() as Variant
    for i=0 to 100000
          Redim Preserve arr(i)
          arr(i)=
    next i
    You are dynamically adding 10000 elements to the array

  3. #3
    Registered User Nucleus's Avatar
    Join Date
    Apr 2001
    Location
    So that's what you are up to ;)
    Posts
    2,530

    use a dynamic array

    dim a() 'dynamic

    then redim when you need to increase the number of elements

    redim a(number)


    eg.

    dim a() as string
    redim a(1)

    a(0) = "gadfly"
    a(1) = "eldritch"

    redim preserve a(2) 'use preserve to retain data in the array

    a(2) = "popinjay"

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