Salut,
type
TOperation = function(const X, Y: Integer): Integer;
function Evaluer(const X,Y: Integer; const Fonction: TOperation): Integer;
begin
result := Fonction(X, Y);
end;
function Add(const A, B: Integer): Integer;
begin
result := A + B;
end;
function Mul(const A, B: Integer): Integer;
begin
result := A * B;
end;
procedure Exemple;
var X,Y,A,M : Integer;
begin
X := 11;
Y := 12;
A := Evaluer(X, Y, Add);
M := Evaluer(X, Y, Mul);
ShowMessage(Format('X= %d, Y= %d // Add= %d // Mul= %d',[X, Y, A, M]));
end;
_______________________________________
Soutenez Wikimédia France aujourd'hui : http://dons.wikimedia.fr