Results 1 to 6 of 6

Thread: [RESOLVED] Clearing all members of a UDT

  1. #1

    Thread Starter
    Lively Member RickyOswaldIOW's Avatar
    Join Date
    Sep 2007
    Location
    Ryde, Isle of Wight
    Posts
    120

    Resolved [RESOLVED] Clearing all members of a UDT

    Greetings, I have a UDT containing two string arrays and dimmed as an array itself. I am wondering if there is a quick way to clear the data from it without writing a nested loop?

  2. #2
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: Clearing all members of a UDT

    Declare another UDT (blank or uninitialized members) in addition to the working (where you do your processing) UDT... whenever you need to clear the working UDT, simply assign it blank UDT to it.

  3. #3

    Thread Starter
    Lively Member RickyOswaldIOW's Avatar
    Join Date
    Sep 2007
    Location
    Ryde, Isle of Wight
    Posts
    120

    Re: Clearing all members of a UDT

    Hm, so you mean I do somthing like this:
    Code:
    Public Type ControlFieldID
        ControlValue(255) As String
        FieldName(255) As String
    End Type
    
    Global BankListViewID(255) As ControlFieldID
    Global Blank(255) As ControlFieldID
    Then, when I want to clear BankListViewID, I just do:
    Code:
    BankListViewID() = Blank()
    ?

  4. #4

    Thread Starter
    Lively Member RickyOswaldIOW's Avatar
    Join Date
    Sep 2007
    Location
    Ryde, Isle of Wight
    Posts
    120

    Re: Clearing all members of a UDT

    I couldn't really figure out what you meant leinad :|
    I've just used this instead:
    Code:
        Dim x As Integer
        x = 0
        Do While x <= 255
            BankListViewID(x) = BlankListViewID(x)
            x = x + 1
        Loop
    Obviously, BankListViewID is used in the application and populated with data whereas BlankListViewID is dimmed but never populated.

  5. #5
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: Clearing all members of a UDT

    It depends on your notion of "reset" or what you are trying to accomplish.

    Try ERASE BankListViewID in the meantime.
    Last edited by leinad31; Sep 23rd, 2007 at 07:23 PM.

  6. #6

    Thread Starter
    Lively Member RickyOswaldIOW's Avatar
    Join Date
    Sep 2007
    Location
    Ryde, Isle of Wight
    Posts
    120

    Re: Clearing all members of a UDT

    Works
    Thankyou

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