Results 1 to 2 of 2

Thread: Explanation : Redim & Redim Preserve

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    NY, USA.
    Posts
    240

    Post

    Could someone clearly explain what is Redim & Redim Preserve, what are they used for and why they are used?

    ------------------
    OmarSwan
    [email protected]
    http://www.omarswan.cjb.net
    To God Be The Glory

  2. #2
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    Calgary Alberta
    Posts
    359

    Post

    Roughly, you use redim when you are setting the dimensions of an array. You use Redim Preserve when you have declared it and put values in and need to change the dimensions without losing hte data.:

    dim strTemp() as string - dims the array variable

    redim strTemp(2) - sets the dimensions of hte array

    strtemp(1) = "Test1"
    strtemp(2) = "Test2"

    redim preserve strTemp(3)

    strtemp (3) = "test3"

    Hope that helps

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