Dear Jamie...
and what about you don't need any variable to be accessible from the outside
of the class, how would you access the value? Would you make one useless
property? And what about if you want the property to be read only, how would
you change the value?

Sorry to tell you, but the guy who taught you programming should return you
money for the lessons...

2009/12/17 Jamie Fraser <[email protected]>

> Inside the class, you should use the property. Outside of the class, you
> should also use the property.
>
>
> On Wed, Dec 16, 2009 at 9:18 AM, Processor Devil <
> [email protected]> wrote:
>
>> inside the same class use i = me._intID :)
>> class properties are used to set or get the variable content out of the
>> current class scope, but yes, either works
>>
>> 2009/12/16 hanks2000 <[email protected]>
>>
>> oops sorry posted by accident, here's the complete example
>>>
>>> Public Property ID() As Integer
>>>        Get
>>>            Return _intID
>>>        End Get
>>>        Set(ByVal value As Integer)
>>>            If Not _intID = value Then
>>>                _intID = value
>>>            End If
>>>        End Set
>>>    End Property
>>>
>>>
>>> Private Sub SomeMethod()
>>>    Dim i As Integer = 0
>>>
>>>     'use this
>>>    i = me._intID
>>>
>>>    'or this
>>>    i = me.ID
>>> End Sub
>>>
>>>
>>> Thanks
>>>
>>
>>
>

Reply via email to