+ Reply to Thread
Results 1 to 5 of 5

Array is not being cleaned up

  1. #1
    Registered User
    Join Date
    01-14-2008
    Posts
    26

    Array is not being cleaned up

    I have an array declared as follows:
    Dim myArray(200, 6) As Double

    I'm declaring this within a for loop.
    But for some reason it is retaining the previous loop's data.
    Is there any reason for this?

    What is the syntax to initialize it to zero?

    Thanks
    Ap

  2. #2
    Forum Contributor
    Join Date
    12-12-2006
    Location
    New Zealand
    Posts
    151
    Was the array explicitly declared at the start of the procedure?

    If not try redim?
    Reafidy.

    Tip: When using code and disabling events/screen updates/calculation be sure to use an error handler to turn them back on if an error occurs.

  3. #3
    Registered User
    Join Date
    01-14-2008
    Posts
    26
    Thanks!
    It helped.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello apka,

    Since you have explicitly declared the array using the Dim statement, you can clear the array using the Erase function.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  5. #5
    Registered User
    Join Date
    01-14-2008
    Posts
    26
    Thanks a lot!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1