wyatt
wyatt

Reputation: 3246

VB2010 accepting pointer to sub as argument

I want to pass the address of a sub as a callback to another method. From what I can find, a function is passed using the format:

Public Sub test(ByRef callback as Func(ArgClass, ReturnClass))

The thing is, as mentioned, I don't want to pass it a function but a sub. There doesn't seem to be an equivalent class Sub which will stand in place of Func, and it won't allow me to set the return class as nothing, so I'm somewhat stumped. How should this problem be solved?

Upvotes: 1

Views: 294

Answers (1)

Adam Maras
Adam Maras

Reputation: 26883

How about trying the Action(Of T) family of delegates? They work just like the Func(Of T) delegate types, except they have no return value.

Upvotes: 2

Related Questions