"Josip Habjan" <jh*****@SPAM-OFF.net.hr> wrote in message
news:d8**********@magcargo.vodatel.hr...
Hi,
Private _mytest As String
Public Property MyTest() As String
Get
Return _mytest
End Get
Set(ByVal Value As String)
_mytest = Value
End Set
End Property
Regards,
Josip Habjan, Croatia
URL: www.habjansoftware.com
"Yomus" <Bu*****@hotmail.com> wrote in message
news:%2*****************@TK2MSFTNGP12.phx.gbl... hi
Does anyone know how to use the get and set command
thanks
Explanation:
The Get and Set keywords are used for properties. The "Getter" is the Get
keyword (statement??) that should always return the value for the property.
The "Setter" is the Set keyword (statement??) that should always set the
value of the property. There are also instances where there would be no
set/get. In these instances, you would use another keyword on the property,
as described below:
Private mUserName As String
Private mPassword As String
Public ReadOnly Property UserName() As String
Get
Return mUserName
End Get
End Property
Public WriteOnly Property Password() As String
Set
mUserName = Value
End Set
End Property
Extra Note:
You do not need the parameter list for the Set like most programmers use.
This extra bit is for clarity I believe but I do not use it as it means
typing more ;)
Set (ByVal Value As String)
mUserName = Value
End Set
gets the same results as
Set
mUserName = Value
End Set
HTH,
Mythran