Classes, Properties, and structures

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: OpticTygre (optictygre_at_adelphia.net)
Date: 10/24/04


Date: Sun, 24 Oct 2004 15:48:10 -0400

Alright, so I'm messing around with some code, and I brought up a good
question to myself.

If creating a class called "Person", and filling that class with variables,
properties like:

Public Class Person
    Private mstrName As String
    Private mdtBirthDate As Date

    Public Property Name() As String
        Get
            Return mstrName
        End Get
        Set(ByVal Value As String)
            mstrName = Value
        End Set
    End Property

etc......

What is the benefit of typing out all that code over defining a simple
structure such as:

Structure Person
    Public Name As String
    Public BirthDate As Date
End Structure

-J



Relevant Pages

  • Re: Classes, Properties, and structures
    ... > Alright, so I'm messing around with some code, and I ... > Private mstrName As String ... > Public Property NameAs String ... opposed to classes which are reference types), or when it is important to ...
    (microsoft.public.dotnet.languages.vb)
  • Re: The use of the in keyword in a comparision??
    ... > Thomas 'PointedEars' Lahn wrote: ... >>> I was messing around with someone elses script when I noticed that ... >>> he had used the in keyword in an if conditional to compare a string ... around with someone elses script" and "compare a string with a object" ...
    (comp.lang.javascript)
  • Re: Date Time Difference
    ... What am I messing up? ... >Public Function CountDownas String ... >Dim lTemp as long ...
    (microsoft.public.access.formscoding)
  • Re: Classes, Properties, and structures
    ... >> Public Class Person ... >> Private mstrName As String ... >> Public Property NameAs String ... > opposed to classes which are reference types), or when it is important to ...
    (microsoft.public.dotnet.languages.vb)
  • RE: Classes, Properties, and structures
    ... ArrayLists of structures can't be bound to controls but arraylists of ... public birthdate as string ... > Private mstrName As String ... > Public BirthDate As Date ...
    (microsoft.public.dotnet.languages.vb)