A function is a routine that returns a value when it executes.
It can be passed parameters and it can return a value. Functions that are part of a class are usually called methods.
You can code your own functions or use built-in functions provided by Delphi RTL (run time library).
Examples:
function YearsOld(const BirthYear:integer): integer; var Year, Month, Day : Word; begin DecodeDate(Date, Year, Month, Day) ; Result := Year - BirthYear; end;