Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
fpc-src / usr / share / fpcsrc / 3.0.0 / tests / webtbs / tw1408.pp
Size: Mime:
{$mode delphi}
program test;

type
        booleanVoidFun = function : boolean;
        boolean1IntFun = function(i : integer) : boolean;

var
        af : array[1..10] of booleanVoidFun;
        ag : array[1..10] of boolean1IntFun;

        b : boolean;
        i : integer;

function alwaysTrue : boolean;
begin
        alwaysTrue := true;
end;

function maybeTrue(q : integer) : boolean;
begin
        maybeTrue := (q = 0);
end;

begin
        for i := 1 to 10 do begin
                af[i] := alwaysTrue;
                ag[i] := maybeTrue;
        end;

        b := af[1]; { can be fixed by using b := af[1]() }
        b := ag[1](0);
end.