Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7687451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:42:24+00:00 2026-05-31T19:42:24+00:00

I have defined a variable with an own type, say Dim point As DataPoint

  • 0

I have defined a variable with an own type, say

Dim point As DataPoint

Public Type DataPoint
   list as Collection
   name as String
   number as Integer
End Type

and I want to delete all values of the variable point at once. If it was a class, I would just use Set point = New DataPoint, or set Set point = Nothing, but how can I proceed if it’s a type?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T19:42:25+00:00Added an answer on May 31, 2026 at 7:42 pm

    The standard way is to reset each member to its default value individually. This is one limitation of user-defined types compared to objects.

    At the risk of stating the obvious:

    With point
        Set .list = Nothing
        .name = ""
        .number = 0
    End With
    

    Alternatively, you can create a “blank” variable and assign it to your variable each time you want to “clear” it.

    Dim point As DataPoint
    Dim blank As DataPoint
    
    With point
        Set .list = New Collection
        .list.Add "carrots"
        .name = "joe"
        .number = 12
    End With
    
    point = blank 
    ' point members are now reset to default values
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Edit: Answered my own question. See below. -_- I have a variable defined in
I have to extract defined variable and function names from a js code passed
I need to mock a GrailsControllerClass interface. Instance should have a static variable defined.
I have a function, where if a variable is not defined, exit; is called,
I have defined a custom Sharepoint list for special attributes related to a software
I'd like to sort a categorical variable my own way. I have grouped my
I have a struct where a constant char string is defined and a pointer
I have a JButton in my program, defined as follows (more or less) public
Is it OK to have a static member variable defined in a base class,
I have a variable define as: set filePath=.\file.txt I'm writing a windows batch file.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.