Public Property Get Arr() As Variant()'定义属性数组
mArr(0) = "aaa"
mArr(1) = "bbb"
Arr = mArr
End Property
'定义参数数组和函数返回值数组
Public Function data(a() As String) As String()
a(0) = "ccc"
a(1) = "ddd"
data = a
End Function
'========================================
调用
Dim tt As New Class1
Dim a(1) As String
Dim b() As String
Dim c() As Variant
b = tt.Data(a)'参数数组以及函数返回值数组的应用
c = tt.arr'属性数组
MsgBox a(0)& ";" & b(0)& ";" & c(0)
显示:"ccc;ccc;aaa"
'***class clsFile
Public Property Get GetKey(sFileName As String, Filekey() As String) As Boolean
'****************
Private Sub Command1_Click()
Dim File As clsFile
Dim sKey As String
Set File = New clsFile
If (File.GetKey("key1.txt", sKey) = True) Then
Else
End If
call subSendKey (sKey)
End Sub
Private Sub subSendKey(Akey As String)
'*************************
这样一来,会"ByRef 参数类型不对"
假如这样写就可以Private Sub subSendKey(Akey),我很迷惑不解 请指教