|
-
Dec 20th, 2000, 02:59 PM
#1
Thread Starter
Lively Member
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
-
Dec 23rd, 2000, 05:34 AM
#2
Hyperactive Member
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
Visual Basic 6.0 Enterprise
Visual C++ 6.0 Professional
Wak 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|