Results 1 to 6 of 6

Thread: How can I declare dynamic, multidimensional arrays?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    Ont, Canada, Earth
    Posts
    458

    How can I declare dynamic, multidimensional arrays?

    How can I declare dynamic multidimensional arrays?
    And how do I re-dim them afterwards?
    Thanks

    Tomexx.

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    You dim them the same as a normal dynamic array. But, you can only re dim the second element, so the first time you re-dim it, make sure the first element is going to be big enough.
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    Ont, Canada, Earth
    Posts
    458
    Are you sure I can only re-dim second element?
    I tried it and it seems that I can redim both of them.
    Thanks

    Tomexx.

  4. #4
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629
    You can preserve only the last dimension (2nd if two dimensions, 3rd if three, etc.) when you redim. If this is too much of a constraint try nesting dynamic arrays.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    Ont, Canada, Earth
    Posts
    458
    Actually, I don't need to preserve any dimmension.
    I just want to be able to re-dim both of them.

    So if I don't need to preserve, can I re-dim with new dimmensions?
    Thanks

    Tomexx.

  6. #6
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Yes, if you do not need the preserve the contents you can redim the array the whatever specification you need...
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

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