Results 1 to 4 of 4

Thread: Get Ready, Get Set, Property Error...

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2001
    Posts
    837

    Get Ready, Get Set, Property Error...

    Just this afternoon i decided to look into properties and realized they would be really good for the program im currently working on.

    i have this code and only this code in a class module:
    Code:
    Private Type Deviations
        Average As Double
        Deviation As Double
    End Type
    
    Dim Dev As Deviations
    
    Public Property Get Deviation() As Double
        Deviation = Dev.Deviation
    End Property
    
    Public Property Get Average() As Double
        Average = Dev.Averages
    End Property
    
    Public Property Set Deviation(SetValue As Double)
        Dev.Deviation = SetValue
    End Property
    
    Public Property Set Average(SetValue As Double)
        Dev.Average = SetValue
    End Property
    when i try to compile it gives me an error:
    Definitions of property procedures for the same property are inconsistent or property procedure has an optional parameter, a ParamArray, or an invalid Set final parameter

    so whats up?
    The human brain cannot hold all of the knowledge that exists in this world, but it can hold pointers to that knowledge.

  2. #2
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930
    Change each Set to Let. Property Set statements are for when the passed in thing is an object.
    I'm baaaack...
    VB5 Professional Edition, VC++ 6
    Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se

    I feel special because I finally figured out how to loop midis: Post link
    I'm a fanatic too

  3. #3
    Hyperactive Member
    Join Date
    Apr 2001
    Posts
    315
    You want PROPERTY LET for implicit LET e.g. (Let) myobj.AVERAGE = .5. PROPERTY SET is for SET statements e.g. SET myobj.someobject = someotherobject.

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    May 2001
    Posts
    837
    thanks

    i must have read it wrong in the help file, cuz i know set is used to objects in other parts of code, but i could have sworn thats the way the help file had it

    anyways
    The human brain cannot hold all of the knowledge that exists in this world, but it can hold pointers to that knowledge.

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