13
我希望能夠以初始化VBA:用值初始化對象?
CArticle
具有下列性質:
Private pNumber As String
Private pQuantity As Double
與任一空的,預先定義的值或電流值。我怎樣才能做到這一點?我沿線的思考的東西:
新的空CArticle
pNumber
pQuantity
新的虛擬CArticle
pNumber
pQuantity = 99999
新初始化CArticle(number, quantity)
pNumber = number
pQuantity = quantity
的[傳遞函數參數構造函數,VBA(可能的複製https://stackoverflow.com/questions/15224113/pass- arguments-to-constructor-in-vba) – Roland 2017-10-04 15:36:12