Explain Get, Let, Set Properties.

Answer Posted / vishal sinha

The Let property is used to assign values to the attributes
of a class. The following is an example of a Let property.

Public Property Let Minute(ByVal m As Integer)
If (m >= 0 And m < 60) Then
mMinute = m
Else
mMinute = 0
End If
End Property


With Get and Set, it's as simple as it sounds...

The Get property is similar to a function in that it returns
a value. It is used return the attributes of a class. The
following is an example of a Get Property called Minute that
returns the private data member, mMinute.

Public Property Get Minute() As Integer
Minute = mMinute
End Property

Objects may not be assigned values directly. Instead, an
object reference is required. With properties, this is
achieved using the Set property.

Public Property Set EndTime(ByVal t As CClock)
Set mFinish = t
End Property

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

DHTML Is used for what?

1496


What is instantiating?

1722


How would you find out the value property in Slider Bar Control?

1544


How do I make the mouse cursor invisible/visible?

1008


Through which protocol OLEDB components are interfaced?

1797






What is the difference between adodc and adodb in vb?

590


Difference between Class Module and Standard Module?

2078


Is the Variant type slower than using other variable types?

1191


___ Property is used to count no. of items in a combobox.

1048


What is the latest version of visual basic?

542


What is controls in vb?

628


How would you map properties to controls by using ActiveX Control Interface Wizard?

1520


What is DAO?

1687


What is the difference between Msgbox Statement and MsgboxQ function?

1533


What is rdo in vb?

633