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
Free Pascal
www.freepascal.org
Free Pascal Wiki
wiki.freepascal.org
Lazarus IDE
www.lazarus-ide.org
Lazarus Forum
forum.lazarus.freepascal.org/index.php?action=forum
Projects Using Lazarus
wiki.freepascal.org/Projects_using_Lazarus