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

Is visual basic still used?

771


VB ActiveX: Create a "drivelist"(D1) box, a "folderlistbox"(FLD1) that changes whenever D1 is changed , and a "FilelistBox"(FIL1) that is populated with the file lists under the selected directory in (D1).The file selected is stored in a variable "filename" along with the path. Question: How to use this activeX control in VC++ to get the selected filename?

1755


What is executenonquery in vb net?

722


What about DLL calls that require callbacks?

1198


What is the need of tabindex property is label control.

1670


How do I play MID, WAV or other multimedia files?

1253


Explain the types of Views in Listview Control.

2512


Can you create a tabletype of recordset in Jet - connected ODBC dbengine?

1808


It possible to call OLEDB?s Features directly in VB without using any control?

1815


__ no of controls in form.

1251


Types of Resultsets.

1739


What is form in visual basic?

743


How do I implement Undo?

1170


How can you determine performance standards?

799


How would you attach pictures in Treeview Control?

1732