On Fri, 10 Jun 2005, L505 wrote:
While converting a KOL regular expression unit for use with freepascal, I came
across only one compile error, in {$mode delphi}
The error was here:
const
RegExprInvertCaseFunction :
TRegExprInvertCaseFunction=TRegExpr.InvertCaseFunction;
Error: Typed constants of the type "procedure of object" can only be initialized
with NIL
The code below seemed to fix the problem, as it compiled ok.
var
RegExprInvertCaseFunction : TRegExprInvertCaseFunction;
Is the error that I got correct even for delphi compatability? Is it bad code,
good code?
It is bad code.
Since there is no instance of TRegExpr, the assignment would only work for
a class method, which makes little sense.
Michael.
_______________________________________________
fpc-devel maillist - [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel