Empty Array

Discussion in 'AutoCAD' started by Dale Levesque, Nov 24, 2004.

  1. Is it possible to set an array back to an empty state? By this I mean the
    state it 's in when created like this:

    Dim Ranges() As Variant

    Thanks,

    Dale
     
    Dale Levesque, Nov 24, 2004
    #1
  2. Got it. "Erase".
     
    Dale Levesque, Nov 24, 2004
    #2
  3. Dale Levesque

    MP Guest

    would ReDim Ranges(0) do that?
    or ReDim Ranges() ?
    don't know if it would or why you'd need to do that but it's an interesting
    question.
     
    MP, Nov 24, 2004
    #3
  4. would ReDim Ranges(0) do that?

    Nope. That would be an array with one element.
    Nope. Thats improper syntax.

    Erase Ranges works fine. The reason I need it empty is because I check
    inside a loop whether the array has been instantiated or not. Another good
    reason to start using collections I suppose.

    Best regards,

    Dale
     
    Dale Levesque, Nov 24, 2004
    #4
  5. Dale Levesque

    MP Guest

    sorry didn't see your repost before i posted those dumb thoughts!
    :)
    Glad you got it.

    amen to that!
    :)
    unless i'm handed an array and have to deal with it, GetAttributes, Split
    etc - well you just gotta deal with the array, but otherwise ....i never
    create one anymore since learning about collections.

    I think there may be some very specialized situations where arrays are
    computationally more efficient but for anything I write it's insignificant.
    ....but then ...with anything i write, what isn't?
    :)
     
    MP, Nov 24, 2004
    #5
  6. Dale Levesque

    TomD Guest

    Thanks for posting your solution, Dale. I really hate it when folks post
    back that they 'found it' without letting others know what 'it' was. ;)
     
    TomD, Nov 29, 2004
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.