1
我开发一个VBScript VBSCRIPT多个语句如下喜欢单Return语句
Dim a
Set a = New Class1
a("text").doSomething 'Has to execute doSomething in Class1
a("text").anotherSomething 'Has to execute doSoemthing in Class2
class Class1
Dim b
Dim c
public default Function init(str)
Set b = New Class2
Set c = New Class3
'Some more operations to perform
If **What is the condition can be?** Then
Set init = c
Else
Set init = b
End If
End Function
End class
class Class2
public Function doSomething()
'Stuff to do something
End Function
End class
class Class3
public Function anotherSomething()
'Stuff to do something
End Function
End class
这里,对象“A”具有参数和这个参数可以是相同的。 所以,我不能保持是参数“=”或“<>”
而且,我不能将这些函数放在Class1中。
那么,什么是可以决定的条件。
多态性是不是在VBScript本地执行,但也有可能是一些解决方法。 – omegastripes