Results 1 to 5 of 5

Thread: Clearing the Array

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2002
    Location
    ENGLAND
    Posts
    38

    Clearing the Array

    Dear All
    My array is like that
    Dim OldArray() as string
    Dim NewArray() as string
    How can I clear this array end of the Procedure
    Many Thanks
    salih
    sa

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Something like:
    OldArray = Nothing

  3. #3
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    The CLR handles memory management for all managed resources. Because an array is a reference type, the garbage collector will deallocate the memory from the heap the next time he runs.

  4. #4
    Junior Member Guile.NET's Avatar
    Join Date
    Mar 2003
    Location
    www.voodoochat.com
    Posts
    31
    Array.Clear(OldArray, 0, MyArray.Length)
    The arrow shot by the archer may, or may not, kill a single person. However, stratagems devised by a wise man, can kill even babes in the womb.

  5. #5
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Since he mentioned clearing the array at the end of the procedure, it sounds like he meant to say 'free the array's memory'.

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