PROGRAM make_a_fruit_salad;

VAR apple,orange,pear,fruit : INTEGER;

PROCEDURE add_the_fruit(value1,value2 : INTEGER;  (* one-way *)
                       VAR total      : INTEGER;  (* two-way *)
                       value3         : INTEGER); (* one-way *)
BEGIN
  total := value1 + value2 + value3;
END;

BEGIN  (* main program *)
  apple := 4;
  orange := 5;
  pear := 7;
  add_the_fruit(apple,orange,fruit,pear);
  WRITELN('The fruit basket contains ',fruit:3,' fruits');
END.  (* of main program *)
