|
-
Jul 21st, 2001, 06:41 PM
#1
Thread Starter
Fanatic Member
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.
-
Jul 21st, 2001, 07:42 PM
#2
Fanatic Member
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 
-
Jul 21st, 2001, 07:46 PM
#3
Hyperactive Member
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.
-
Jul 21st, 2001, 09:58 PM
#4
Thread Starter
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|