Results 1 to 2 of 2

Properties in a class - can't write to them

Threaded View

  1. #1
    Registered User
    Join Date
    02-09-2007
    Posts
    29

    Properties in a class - can't write to them

    I can’t seem to correctly use a property in a class. Here is my code:


    Public Property Get StartingLocation() As Integer
        StartingLocation = pStartingLocation
    End Property
    
    Public Property Let StartingLocation(Value As Integer)
        pStartingLocation = Value
    End Property

    Next my module:

        Dim myclass As Class1
        Set myclass = New Class1
            
        myclass.StartingLocation = 10
        MsgBox (myclass.StartingLocation)
    The messagebox displays “0”

    What the heck?
    Thanks.
    Last edited by Lazhal; 08-03-2010 at 04:41 PM.

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