Results 1 to 9 of 9

Thread: [RESOLVED] Clearing a Structure

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2007
    Posts
    10

    Resolved [RESOLVED] Clearing a Structure

    Hi trying to check I have cleared this correctly. Seems to have worked byt I seem to get anomolies somethimes that might have nothing to do with the clear part.

    I declare the structure. Dimension it, then when I need to clear call the Sub to clear it.

    1) Will this clear it all, including the array within the structure?

    2) Incidentally I dimension it after as it is here in the example. Is there a way of doing it when actually needed so I have a better idea of how many items to allocate as opposed to an arbitrary number as here in the example of 30?

    Code:
        Structure TestList
            Dim TL_name As String
            Dim TL_total As Integer
            Dim TL_Sub_total_Array() As Integer
            Dim TL_reference As Integer
        End Structure
    
        Dim TotalList(30) As TestList
    
        Private Sub Clear_Rows_Display()
            Dim count1 As Integer
            For count1 = 0 To TestList.GetUpperBound(0)
                Array.Clear(TestList, 0, count1)
            Next
        End Sub
    Thanks in advance.
    Last edited by Writers Block; Jul 2nd, 2007 at 05:04 AM.

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