1. Home
  2. Computing & Technology
  3. Delphi Programming

Function

By Zarko Gajic, About.com Guide

Definition: A function is a routine that returns a value when it executes.

It can be passed 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;
Explore Delphi Programming
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Getting Started with Delphi
  5. Delphi Programming Glossary
  6. Function - Glossary - Delphi Programming

©2009 About.com, a part of The New York Times Company.

All rights reserved.