[lazarus] Calling boolean type function

Jean Bénard jean.benard at domsoc.u-psud.fr
Thu Mar 30 02:10:57 EST 2000


At 02:09 30/03/00 +0100, you wrote:
>Hi, I got the following problem:
>
>function Test: Boolean

JB : well a ; is missing here (it wasn't a copy/paste !)

>begin
>end;
>
>type
>   TMyFunc = function: Boolean;
>var
>   b: Boolean;
>   MyFunc: TMyfunc;
>
>begin
>   MyFunc := @Test;

in Delphi for Windows, the @ is refused as well
while it compiles without @

>   b := MyFunc;
>end;
>
>The compiler complains about:
>
>   Error: Incompatible types: got "TMYFUNC" expected "BOOLEAN"
>
>Am I missing something ??

No : on the contrary, the @ should be dropped.

Jean Bénard Informatique premier cycle
Bât 336 Campus d'Orsay
91405 ORSAY Cedex






More information about the Lazarus mailing list