The code below in the code block is from the MSDN site.
My question is I want a method that always increases the value of a property stored in the object by one. I do not want to pass a value in the call using a method.
Public Sub IncreaseByOne()
m_OrderCount = m_OrderCount + 1
Is the above ok? Am I forced to pass a variable into the method?
Private Sub Class_Initialize
m_CustomerName = ""
m_OrderCount = 0
' CustomerName property.
Public Property Get CustomerName
CustomerName = m_CustomerName
Public Property Let CustomerName(custname)
m_CustomerName = custname
' OrderCount property (read only).
Public Property Get OrderCount
OrderCount = m_OrderCount
Public Sub IncreaseOrders(valuetoincrease)
m_OrderCount = m_OrderCount + valuetoincrease
Set c = New Customer
c.CustomerName = "Fabrikam, Inc."