firstnumber, secondnumber : integer;

result : integer;

function add_two_numbers(number1, number2 : integer) : integer;

var

total : integer;

begin

total := number1 + number2;

add_two_numbers := total;

end;

begin

firstnumber := 10;

secondnumber := 22;

result := add_two_numbers(firstnumbe

A function is a little box that you drop variables into and do some work on them and get something out. The something out is expressed by when use the function name.

In the above example when I used add_two_numbers := total that is giving the function output.

Input to the function was here.

add_two_numbers(number1, number2 : integer) : integer;

It expects two integers and will return one integer.