redim, preserve

Results 1 to 4 of 4

Thread: redim, preserve

  1. #1
    pink Guest

    Default redim, preserve

    Can u explain redim and preserve.

  2. #2
    Join Date
    Dec 1969

    Default RE: redim, preserve

    ReDim is used to modify the size of Dynamic Arrays (arrays where you do not know how many elements may be ulimately contained) - so you can change the size in you program to meet your needs.<BR><BR>BUT each time that you change the size of the array with ReDim, the current contents (all of the data that you have carfully inserted) are normally lost (NOTHING for object arrays, 0-length strings for string arrays etc....) To PRESERVE the array contents you use the &#060;&#060;ReDim Preseve myDynamicArray(somenumber)&#062;&#062; combination

  3. #3
    pink Guest

    Default RE: redim, preserve

    Thanks very much shroshire . That helped

  4. #4
    RDM Guest

    Default Powerful but don't abuse...

    ...If you can avoid a large number Redim Preserve on "larger" arrays (more than 100 elements), do so. Redim Preserve is expensive as far as resources go.<BR><BR>If you know the array will not exceed a certain number. It is best to originally create your array with more elements than you need and then perform Redim Preserve at the end to properly size your array.

Posting Permissions

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