logo
  • 教程列表
  • SO官方文档
  • 使用类
    • 创建一个类
    • 使用类实例
    • 全局工厂函数模拟参数化构造函数
    • 用于模拟参数化构造函数的 Init 方法
    • 将外部类文件加载到脚本中
  1. StackOverflow 文档
  2. vbscript 教程
  3. 使用类
  4. 全局工厂函数模拟参数化构造函数

全局工厂函数模拟参数化构造函数

Created: November-22, 2018

' Making a factory with parameter to the class
Public Function new_Car(wheels)
    Set new_Car = New Car
    new_Car.Wheels = wheels
End Function

' Creating a car through a factory
Dim semiTrailer
Set semiTrailer = new_Car(18)
  • 用于模拟参数化构造函数的 Init 方法
  • 使用类实例

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明