Hi folks,
Just trying to tidy up my code and have an issues assigning members to a structure that contains a Delegate.
I tried this initially and it works, but, it's long and tedious.
Public Delegate Sub NAH()
Structure sDirective
Public DirectiveName As String
Public DirectiveFunction As NAH
End Structure
Dim DirectiveList(10) As sDirective
then ...
With DirectiveList(0)
.DirectiveName = "END"
.DirectiveFunction = New NAH(AddressOf DirectiveEND)
End With
This works.
I have 15 elements.
I would like to do something like this
Dim DirectiveList() as sDirective = {{"END", New NAH(Addressof DIRECTIVEEND}, etc}
Any ideas?
Thanks.
Just trying to tidy up my code and have an issues assigning members to a structure that contains a Delegate.
I tried this initially and it works, but, it's long and tedious.
Public Delegate Sub NAH()
Structure sDirective
Public DirectiveName As String
Public DirectiveFunction As NAH
End Structure
Dim DirectiveList(10) As sDirective
then ...
With DirectiveList(0)
.DirectiveName = "END"
.DirectiveFunction = New NAH(AddressOf DirectiveEND)
End With
This works.
I have 15 elements.
I would like to do something like this
Dim DirectiveList() as sDirective = {{"END", New NAH(Addressof DIRECTIVEEND}, etc}
Any ideas?
Thanks.
Last edited: