I have
Function Bar(s As String) ...
I need to create a function
Me.Foo(myInt, AddressOf Bar)
How should I write the Foo's signature?
Declare your delegate signature:
Public Delegate Sub Format(ByVal value As String)
Define your Test function:
Public Sub CheckDifference(ByVal A As Integer, _
ByVal B As Integer, _
ByVal format As Format)
If (B - A) > 5 Then
format.Invoke(String.Format( _
"Difference ({0}) is outside of acceptable range.", (B - A)))
End If
End Sub
Somewhere in your code call your Test function:
CheckDifference(Foo, Bar, AddressOf log.WriteWarn)
Or
CheckDifference(Foo, Bar, AddressOf log.WriteError)