Introduction to OOP | Chapter 15: Overloading : | next | previous | audio | real | text |
function Count (A, B : Integer; C : Integer = 0; D : Integer = 0); begin (* Result is a pseudo-variable used *) (* to represent result of any function *) Result := A + B + C + D; end begin Writeln (Count(2, 3, 4, 5)); // can use four arguments Writeln (Count(2, 3, 4)); // or three Writeln (Count(2, 3)); // or two endSuch a program will have more than one type signature.