我们可以在VBScript函数中编写类吗?

我们可以在VBScript函数中编写类吗?,vbscript,qtp,Vbscript,Qtp,不可以。函数在类中称为方法。那么如何在函数中使用try-catch功能?VBScript没有try-catch。接下来我们使用错误恢复。因此,在每个潜在错误之后,如果err.number为0,则执行以下操作:err.clear Function CWSLogin(strApplicationPath,strUser,strMember,strPassword) Class TryCatchFinally Private Sub Class_Initialize 'T

不可以。函数在类中称为方法。

那么如何在函数中使用try-catch功能?VBScript没有try-catch。接下来我们使用错误恢复。因此,在每个潜在错误
之后,如果err.number为0,则执行以下操作:err.clear
Function CWSLogin(strApplicationPath,strUser,strMember,strPassword)

    Class TryCatchFinally

         Private Sub Class_Initialize 'Try

         End Sub

    End Class

End Function