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

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

1441


How would you add elements and pictures to listitems in listview control?

1453


Data Control missing from toolbox when I use VB under NT3.5. Why?

933


Where can I get good up-to-date information about VB?

916


What are some methods you can use to send data from one VB executable to another one?

1814






What is Seek Method which type of record set is available this?

1510


Explain about conditional operators?

578


Is there a way to break long lines in VB code?

964


What is meant by building a recordset.

613


What is executenonquery in vb net?

517


What are the important components of OLEDB?

2413


What is the need of tabindex property is label control.

1437


Which method is used to write context Into file?

1573


Recordset object consists what?

1578


DHTML Is used for what?

1471