Class klass
Private Shared state As Boolean
Public Sub savestate (ByVal value As Boolean)
state = value
End Sub
Public Function getstate () As Boolean
Return state
End Function
Private Sub work()
savestatet(false)
End Sub
Private Sub work2()
If getstate()
....
End Sub
...
End Class
以这种方式使用共享变量还是像state = false, and if state... do something
.