[fpc-devel] Minor Error in $delphi mode for a unit I'm converting
Florian Klaempfl
F.Klaempfl at gmx.de
Sat Jun 11 00:17:35 CEST 2005
Michael Van Canneyt wrote:
>
>
> 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;
Can you create a complete example and in the best case add it to the bug
repository please?
>>
>> 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 - fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
More information about the fpc-devel
mailing list