Sign in Join
Wiki copytemporary

Function/es

Deutsch · English · Español · Français · Suomi · Русский

Vision General

Una funcion es una declaracion de una rutina que puede ser invocada

La rutina devuelve un valor como parte de su definicion. Una rutina que no devuelve un valor como parte de su definicion es un procedure.

Una funcion que es parte de un objeto es conocida como una propiedad y puede ser asignada/devuelta como valor (si no puedes asignarle un valor, esta deberia ser un metodo)

Parametros de Funcion

Ejemplos

Suma de dos Enteros enteros ejemplo:

pascal
 function suma(c1, c2 : integer) : integer;
 begin
   suma := c1 + c2; //o use result := in Object Pascal/Delphi mode
 end;

 var 
   total: integer;

 begin
   total := suma(4, 5);
   writeln (total); // el resultado es 9
 end.

From the Free Pascal wiki, page "Function/es", as it stood on 2020-01-31 after a change by GAN, out of the wiki's dump of 2024-05-26. 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.

Revision 3, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.