Re: why doesn't this compile
- From: "Saga" <antiSpam@xxxxxxxxxxxxx>
- Date: Fri, 2 Jun 2006 11:56:54 -0500
Public Property Get foo() As String()
foo = foo1
End Property
Above, you are returning an array
Dim s As String
s = fooList(0).foo(0)
Above, foo return array, but s is just a string.
Also... your foo prperty takes no parameters, but in
the above snippet you are passing a 0 (zero) to foo.
Dim fooList(0 To 6) As Class1
Above you dim the array of classes, but where do you
"set fooList(0) = new Class1" it?
later
Saga
"Andy Fish" <ajfishNON@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:%23ssj2QmhGHA.204@xxxxxxxxxxxxxxxxxxxxxxx
create a new class called Class1 with the following
Option Explicit
Private foo1() As String
Public Property Get foo() As String()
foo = foo1
End Property
this creates a class with a public property which is an array of strings, correct?
so why does this not compile?
Dim fooList(0 To 6) As Class1
Dim s As String
s = fooList(0).foo(0)
it gives "wrong number of arguments or invalid property assignment"
whereas this works fine
Dim ss() As String
ss = fooList(0).foo
s = ss(0)
I'm mystified
Andy
.
- Follow-Ups:
- Re: why doesn't this compile
- From: Andy Fish
- Re: why doesn't this compile
- References:
- why doesn't this compile
- From: Andy Fish
- why doesn't this compile
- Prev by Date: Re: JET
- Next by Date: Re: Shell to open .mdb file
- Previous by thread: why doesn't this compile
- Next by thread: Re: why doesn't this compile
- Index(es):
Relevant Pages
|