Sign in Join
Wiki copytemporary

Revision 2 of 3, by WikiArchive on 11-4-2026. The page as it is now.

Function/fr

Overview

Une fonction est une déclaration d'une routine qui peut être invoquée

La routine retourne une valeur dans la cadre de sa définition. Une routine qui ne retourne pas de valeur dans le cadre de sa définition est une procédure.

Une fonction qui fait partie d'une classe est appelée propriété et peut être affectée et retourner une valeur (si vous ne pouvez pas affecter de valeur, il s'agit d'une méthode.

Paramètres de fonctions

Exemples

Exemple d'addition de deux entiers :

pascal
function add(c1, c2 : integer) : integer;
     begin
     add := c1 + c2; //or use result := in Object Pascal/Delphi mode
     end;
    
     var 
       total: integer;
    
     begin
       total := add(4, 5);
       writeln (total); // result is 9
     end.

From the Free Pascal wiki, page "Function/fr", as the Internet Archive kept it on 2022-08-14. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.