Delphi mode

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Delphi mode

Carsten Bager
Is there another way writing this without activating Delphi mode.

Carsten



type
  tKeypressed=function:boolean;

Var
pKeypressed:tKeypressed;


Function Keypressed:boolean;

Implementation

Function Keypressed:boolean;
Begin
  if pointer(pKeypressed)<>nil then
    Keypressed:=pKeypressed
  else Keypressed:=false;
End;

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Delphi mode

Joao Morais
Carsten Bager wrote:

> Is there another way writing this without activating Delphi mode.
>
> Carsten
>
> type
>   tKeypressed=function:boolean;
>
> Var
> pKeypressed:tKeypressed;
>
> Function Keypressed:boolean;
>
> Implementation
>
> Function Keypressed:boolean;
> Begin
>   if pointer(pKeypressed)<>nil then
>     Keypressed:=pKeypressed

Changing to Keypressed := pKeypressed() ?

>   else Keypressed:=false;
> End;

Joao Morais
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal