Is there a syntax to use System.Text.RegularExpressions.MatchEvaluator?
At first try, I'd say that this is not feasible even under 10.2B with class Events delegates, but I just want to be sure.
Sample VB code to instanciate the class is:
Dim myEvaluator As MatchEvaluator = New MatchEvaluator(AddressOf ReplaceCC)
where ReplaceCC is an internal method of the current class defined as:
Public Function ReplaceCC(ByVal m As Match) As String
David,
You're correct -- there is no way to instantiate a delegate in ABL, even though you can use a delegate type to define an event.
--Wayne
You're correct -- there is no way to instantiate a delegate in ABL,
even though you can use a delegate type to define an event.
But with the caveat that the delegate have a void return type (the MatchEvaluator returns string, so I'm not sure how one'd go about that).
-- peter
Peter's caveat is, of course, correct. Delegates that you use to define ABL class events have to conform to the .NET convention for event handlers -- void return and two parameters, where the first parameter is a System.Object and the second is System.EventArgs or a type derived from System.EventArgs. Both MatchEvaluator's return type and its parameter list disqualify it from being used to define an ABL class event.