我在这个StackOverFlow问题,VBScript中的对象/类的字典中找到了这段代码.
我的问题是为什么这个"短"课与这个"长"课做同样的事情?为什么甚至打扰长码?短类版本可以与同一类中的其他方法一起使用吗?谢谢!
短班
Class employeeclass
Public first, last, salary
End Class
Run Code Online (Sandbox Code Playgroud)
长班
Class employeeclass
Private m_first
Private m_last
Private m_salary
Public Property Get first
first = m_first
End Property
Public Property Let first(value)
m_first = value
End Property
Public Property Get last
last = m_last
End Property
Public Property Let last(value)
m_last = value
End Property
Public Property Get salary
salary = m_salary
End Property
Public Property Let salary(value)
m_salary = value
End Property
End Class
Run Code Online (Sandbox Code Playgroud)
但是,使用短类的完整脚本,只需用long类替换短类就可以获得相同的结果.
Class …Run Code Online (Sandbox Code Playgroud)