+ Reply to Thread
Results 1 to 3 of 3

Defining a Property

  1. #1
    Cody
    Guest

    Defining a Property

    How would I define a collection as a property of a class?

  2. #2
    Cody
    Guest

    RE: Defining a Property

    I just posted and I think the post is lost so here goes again:

    I am trying to create an polygon area as a class. As part of the definition
    of each instance of the area is the collection of points defining corners
    around its perimeter. The number of sides is equal to the number of corners.

    I also created a class called PolyPoint with the properties of the
    coordinates of a point.

    I am trying to add a collection of PolyPoints to each instance of the area
    class.

    "Jim Thomlinson" wrote:

    > You have me a little lost here. A collection is not really a property but
    > more of a container for objects. So what do you mean by a perperty. Do you
    > mean the prperties of the objects within the collection? You can make the
    > collection accessible as a part fo teh class by just declaring it public kind
    > of like this
    >
    > CLASS
    > Option Explicit
    >
    > Public col As Collection
    >
    > Private Sub Class_Initialize()
    > Set col = New Collection
    > End Sub
    >
    > MODULE
    > Sub test()
    > Dim var As Class1
    >
    > Set var = New Class1
    >
    > var.col.Add Sheet1, Sheet1.Name
    > End Sub
    > --
    > HTH...
    >
    > Jim Thomlinson
    >
    >
    > "Cody" wrote:
    >
    > > How would I define a collection as a property of a class?


  3. #3
    Jim Thomlinson
    Guest

    RE: Defining a Property

    You have me a little lost here. A collection is not really a property but
    more of a container for objects. So what do you mean by a perperty. Do you
    mean the prperties of the objects within the collection? You can make the
    collection accessible as a part fo teh class by just declaring it public kind
    of like this

    CLASS
    Option Explicit

    Public col As Collection

    Private Sub Class_Initialize()
    Set col = New Collection
    End Sub

    MODULE
    Sub test()
    Dim var As Class1

    Set var = New Class1

    var.col.Add Sheet1, Sheet1.Name
    End Sub
    --
    HTH...

    Jim Thomlinson


    "Cody" wrote:

    > How would I define a collection as a property of a class?


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1