In a User-Defined Class:
For "derived" properties, rather than base properties, is there any difference between coding these as properties or coding them as functions.
e.g. is there any advantage to using the "Area" property versus the "Area2" function in the following? Or visa versa?
VB Code:
Option Explicit Private pLGH As Long Private pHGT As Long 'base properties - lets and gets Public Property Let Length(newLength As Long) pLGH = newLength End Property Public Property Let Height(newHeight As Long) pHGT = newHeight End Property Public Property Get Length() As Long Length = pLGH End Property Public Property Get Height() As Long Height = pHGT End Property 'derived property - using property Public Property Get Area() As Long Area = pLGH * pHGT End Property 'derived property - using function Public Function Area2() As Long Area2 = pLGH * pHGT End Function




Reply With Quote