请教高手:VBScript classes
luco 2003-03-03 11:40:10 我用VBScript engine 5.6 来create 一个Class A 和一个Class B
代码如下:
<%
Class A
private mName
Public Property Get name()
name = mName
End Property
Public Property Let name(pName)
mName = pName
End Property
End Class
Class B
private objA
Private Sub Class_Initialize()
Set objA = New A
End Sub
Public Property Get A()
Set A = objA
End Property
Public Property Let A(pObjA)
Set objA = pObjA
End Property
End Class
dim objTest
Set objTest = new B
%>
问题是:老是说
Error Type:
Microsoft VBScript runtime (0x800A01FA)
Class not defined: 'A'
错误代码在 Class_Initialize 里面,请问为什么?? 当我把
Public Property Get A()
Set A = objA
End Property
Public Property Let A(pObjA)
Set objA = pObjA
End Property
注释掉后,就没有错,搞不清楚应该如何做。拜托各路大虾,小弟在线等待...