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

Explain the working of templates?

580


How would you attach pictures in column headers of List View Control?

1671


What is the use of Tabledef?

1570


What is dao in vb?

517


What is the default workspace?

1512






How would you add elements in TreevieW Control.

1537


what are the Types of LockEdits in RDO?

1564


How would you add column headers in listview control?

1667


Binary Access-method isused to access file in which manner?

1427


What is FireHouse Cursors?

1769


What are the Differenct Types of Instancing Property in ActiveX Dll and Exe?

1633


What is the use of Active Control Property?

1480


How can you filter out specific type of file using file system controls?

1410


Explain the types of Views in Listview Control?

1782


What is ado data control in vb6 0?

635