I have two classes, one initialises with class_initialise, and the other using a default function. The one that uses a default function references the other directly. But I can't see values assigned to its properties. If I change them both to use class_initialise, it works. But I need to (eventually) pass parameters to the initialiser, so default function it is.
class cls1
Public foo
Private Sub Class_Initialize
foo = "foo"
End Sub
End Class
Class cls2
Public Bar
Public Default Function Init()
Call SetBar()
Set Init = Me
End Function
Private Sub SetBar()
bar = fooclass.foo & ".bar"
End Sub
End Class
Dim fooclass: Set fooclass = new cls1
Dim barclass: Set barclass = new cls2
Now
MsgBox fooclass.foo ' Shows "foo"
MsgBox barclass.bar ' is empty, not even ".bar"
I'm sure there's something appallingly simple jumping out of the screen at me, but I can't figure out what it actually is!