Free Pascal Lazarus Program Tutorial 17 - Functions



Functions are just like procedures, with one main exception. The exception is that functions return a value. The name of the function becomes the value that the function is returning. For example, the name of the function is squared and squared becomes the value (x * x).

Function Example
function squared(var x:integer):integer;
begin
  squared := x * x;
end;

Code Download
FPProgT17.zip