Public Class Mygrand
    Private g1 As Integer
    Public g2 As String
    Public Function cntg(ByVal x As String) As String
        g2 = CStr(Len(x))
        Return g2
    End Function
    Public Sub setg()
        exg1 = 1
        g2 = "two"
    End Sub
    Public Property exg1() As Integer
        Get
            If (g2 = "zero") Then Return 0 Else Return g1
        End Get
        Set(ByVal value As Integer)
            If (g2 = "two") Then g1 = 2 Else g1 = value
        End Set
    End Property
End Class
