-
Hi,
I have a class named clsXArray, that have a property like this:
Private intArray(40) as integer
and its properties Let and Get (like this)
Public Property Get MyArray(Pos as Integer) as Integer
MyArray = intArray(Pos)
end property
Public Property Let MyArray(Pos as Integer,intValue as Integer)
intArray(Pos) = intValue
end property
ok
Well, this class it's a property of another class.
Remember, the property "MyArray" its the default property.
dim MyObject as AnotherClass
(thearray as clsXArray)
Ok, when i do this
x = MyObject.thearray(5)
works, but if i do this
MyObject.thearray(5) = 5
vb falls in an compiling error,
but, if i make this way
MyObject.thearray.myarray(5) = 5
NO PROBLEM. WHYYYYYYYY ????????
(i already initialize the property "thearray" with new)
Thanks
-
Property mismatch
When you call tharray which I am assuming is in a class file. You are wanting to access a property. And if you don't call the property, VB will call error. When accessing thearray, you have to call the myarray property. Is thearray section really needed. As I said, I'm not too sure, but could you just call MyObject.MyArrar(5) = 5 ??
:) Best of luck :)