[fpc-devel] Minor Error in $delphi mode for a unit I'm converting

L505 fpc505 at z505.com
Fri Jun 10 11:27:52 CEST 2005


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?

I have no idea myself.. looking for your guys' input.
Regards,
Lars





More information about the fpc-devel mailing list